Why is the use of Maybe/Option not so pervasive in Clojure? [closed]

Clojure is not statically typed, so doesn’t need the strict this/that/whatever type declarations that are necessary in haskell (and, I gather, Scala). If you want to return a string, you return a string; if you return nil instead, that’s okay too.

“Functional” does not correspond exactly to “strict compile-time typing”. They are orthogonal concepts, and Clojure chooses dynamic typing. In fact, for quite some time I couldn’t imagine how you could implement many of the higher-order functions like map and still preserve static typing. Now that I have a little (very little) experience with Haskell, I can see that it’s possible, and indeed often quite elegant. I suspect that if you play with Clojure for a while, you will have the opposite experience: you’ll realize the type declarations aren’t necessary to give you the kind of power you’re used to having in a functional language.

Leave a Comment