|
Summary: The function map
suclist :: [Int] -> [Int]
suclist [] = []
suclist (x:xs) = suc x : suclist xs
sqrtlist :: [Float] -> [Float]
sqrtlist [] = []
sqrtlist (x:xs) = sqrt x : sqrtlist xs
map :: (a -> b) -> [a] -> [b]
map g [] = []
map g (x:xs) = g x : map g xs
suclist :: [Int] -> [Int] sqrtlist :: [Float] -> [Float]
suclist = map suc sqrtlist = map sqrt
The function filter
dropEven :: [Int] -> [Int]
dropEven [] = []
dropEven (x:xs) | odd x = x : dropEven xs
| otherwise = dropEven xs
dropUpper :: [Char] -> [Char]
dropUpper [] = []
|