Skip to content

Files

Latest commit

370ffb1 · Oct 14, 2019

History

History

types

types

stack ghci types

Implement following modules & functions:

Implement as many functions you would normally need from Prelude as possible (import only Int, (+), (*) and Show)

  • const
  • id
  • flip
  • (.)
  • ($)

readme

  • List type definition (2 constructors: Empty and Cons)

  • foldl

  • foldr

  • prepend

  • head

  • tail

  • zeroTo - (e.g. zeroTo 5 = [0, 1, 2, 3, 4, 5])

  • range - (e.g. range 2 7 = [2, 3, 4, 5, 6, 7])

  • repeat - (e.g. repeat 3 9 = [9, 9, 9])

with foldl / foldr

  • append
  • sum
  • product
  • length
  • reverse
  • map
  • filter
  • concat
  • concatMap (:: (a -> List b) -> List a -> List b)
  • Bool data type definition (True and False)
  • if'
  • Maybe type definition
  • fmap
  • maybe