I want map (the function). I want filter. And I don't want to keep rewriting them over and over when I work on projects.
They're not required -- indeed, I get by without them --, but the topic of the OP is elegance.
They're not required -- indeed, I get by without them --, but the topic of the OP is elegance.
Other languages, Nimrod for instance (http://nimrod-lang.org/system.html#515) can manage this while still keeping a simple core, including lots of type-inference. Having generics doesn't automatically turn your language into Java.
The map operator in Nimrod has a definition that is clear and simple:
proc map[T](data: var openarray[T]; op: proc (x: var T): S): seq[S]https://github.com/mediocregopher/seq
It provides clojure-like data-structures and functions for interacting with them (like map and filter). It's completely immutable and generic, and supports lazy operations.