Is there a way to write an implementation of the Haskell map
function using list implementation?
I keep getting an error and I do not think I am on the right track. This is what I have:
map' :: (a -> b) -> [a] -> [b]
map' _ [] = []
map' xs ys = [ (x, y) | x <- xs | y <- ys ]
Any help or link that will guide me in the right direction would be much appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…