Skip to content

Instantly share code, notes, and snippets.

@Rembane
Created December 22, 2022 21:07
Show Gist options
  • Save Rembane/119668a0553b8d031eb70d50c9948b4f to your computer and use it in GitHub Desktop.
Save Rembane/119668a0553b8d031eb70d50c9948b4f to your computer and use it in GitHub Desktop.
import Prelude hiding (map)
map :: (a -> b) -> [a] -> [b]
map f xs = foldr (\x acc -> f x:acc) [] xs
main :: IO ()
main = print $ map (+2) [1,2,3,4,5,6,7,8,9,10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment