> I bet you some of the functionality that you wrote can be factored out into a more generic library that applies to everyone's use case.
Of course. We publish quite a few such libraries, in fact. :)
Search for "NoRedInk" on http://package.elm-lang.org
For example, Rust has typeclasses (called traits) and Rust has a lot of libraries that do the right thing for you.
Here, the functions first and second are taken from tool.rs, fold1 is from itertools, the type Monoid and the function op is taken from monoid.I did have to write the delayed apply function myself, though. It's definition is:
I think that could also be in a library somewhere