Advertisement
VladNitu

W2L1(Lecture3)-FP24-Vlad-Batch2Q4-WL

Feb 18th, 2024
1,347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Prelude hiding (map, iterate)
  2.  
  3. map :: (a -> b) -> [a] -> [b]
  4. map f xs = unfold null (f . head) (tail) xs
  5.  
  6. iterate :: (a -> a) -> a -> [a]
  7. iterate f x = unfold (\x -> False) id f x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement