Skip to content

Instantly share code, notes, and snippets.

@jtrim
Created January 2, 2015 02:35
Show Gist options
  • Select an option

  • Save jtrim/4ba447a986cc4aebce23 to your computer and use it in GitHub Desktop.

Select an option

Save jtrim/4ba447a986cc4aebce23 to your computer and use it in GitHub Desktop.
let theStuff = ["foo", "bar", "baz"]
-- in foldl............................................. vvv is first, vvv is second...
let wtffoldl = foldl iterator "" theStuff where iterator concatedStuffs stuff = concatedStuffs ++ stuff
-- ...but in foldr.......................................vvv and vvv are reversed.
let wtffoldr = foldr iterator [] theStuff where iterator stuff concatedStuffs = stuff ++ concatedStuffs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment