stack ghci types
Implement following modules & functions:
Implement as many functions you would normally need from
Prelude
as possible (import onlyInt
,(+)
,(*)
andShow
)
-
const
-
id
-
flip
-
(.)
-
($)
-
List
type definition (2 constructors:Empty
andCons
) -
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]
)
-
append
-
sum
-
product
-
length
-
reverse
-
map
-
filter
-
concat
-
concatMap
(:: (a -> List b) -> List a -> List b
)
-
Bool
data type definition (True
andFalse
) -
if'
-
Maybe
type definition -
fmap
-
maybe