Earlier quoted context omitted.
Haskell has Hoogle[1], which allows you to search for functions using a type signature. This is surprisingly effective. Let's say you want that `contains` function from the original post. You'd search for `(Eq a) => a -> [a] -> Bool`, which describes a function that takes two parameters and returns a boolean. The first result[2] is the `elem` function, which is exactly what we wanted! This is a bit of a contrived exa…
Does the order of the parameters matter? It's been a while since I've touched Haskell, so maybe it's obvious that this isn't [a] -> a -> Bool for some idiomatic reason. I guess that would be `isContained` instead of `contains`, so it probably wouldn't be the first thing I search for, but there's at least some potential for ambiguity.
map (elem x) [list1, list2, ..., list10]
or, for folds, the function is the one least likely to change, so you put it first, and the list is most likely to change, so you put it last: foldl (+) 0 [1,2,3]
map (foldl (-) 100) [[1,2],[2,3],[4,19]]
Of course, it's always debatable if you can find some situation where you wanted to curry in a different order, but generally you pick in order to reduce forced named lambda parameters. As far as I can tell, that's how it's done.Edit: if you saw the sneaky edit, you'll know that this particular convention isn't easy to follow!