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 … Read more

ST Monad == code smell?

I don’t use ST much, but sometimes it is just the best solution. This can be in many scenarios: There are already well-known, efficient ways to solve a problem. Quicksort is a perfect example of this. It is known for its speed and in-place behavior, which cannot be imitated by pure code very well. You … Read more

Why are Promises Monads?

UDATE. See this new library providing functor and monad operators for plain callback-based functions that do not have the issues with theneables: https://github.com/dmitriz/cpsfy The JS Promise is neither a Functor nor an Applicative nor a Monad It is not a functor, because the composition preservation law (sending compositions of functions to compositions of their images) … Read more

Why monads? How does it resolve side-effects?

The point is so there can be clean error handling in a chain of functions, containers, and side effects. Is this a correct interpretation? Not really. You’ve mentioned a lot of concepts that people cite when trying to explain monads, including side effects, error handling and non-determinism, but it sounds like you’ve gotten the incorrect … Read more

Creative uses of monads

Phil Wadler has written many papers on monads, but the one to read first is a lot of fun and will be accessible to any programmer; it’s called The essence of functional programming. The paper includes source code and sample usages. A personal favorite of mine is the probability monad; if you can find Sungwoo … Read more

What is a monad in FP, in categorical terms?

This question has some good answers: Monads as adjunctions More to the point, Derek Elkins’ “Calculating Monads with Category Theory” article in TMR #13 should have the sort of constructions you’re looking for: http://www.haskell.org/wikiupload/8/85/TMR-Issue13.pdf Finally, and perhaps this is really the closest to what you’re looking for, you can go straight to the source and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)