Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created December 1, 2017 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethagnawl/4a3fac90bcee97d242c11fdc54d81f2a to your computer and use it in GitHub Desktop.
Save ethagnawl/4a3fac90bcee97d242c11fdc54d81f2a to your computer and use it in GitHub Desktop.
replicate' l = map (\n -> take n (repeat n)) l
replicate' [1, 2, 3] -- [[1],[2,2],[3,3,3]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment