Hacker News new | past | comments | ask | show | jobs | submit login

> Can you explain why? Because its my experience that monads, once you understand them even a little bit, open up a way of thinking about and addressing problems that can be productively used in most programming languages (Python certainly included).

I talked about part of the answer to this question at the New York Haskell Meetup awhile back.

http://vimeo.com/59215336




The criticism there doesn't seem to be about why static typing is particularly a bar to productive use of monads, just the general criticism that dynamic languages lack type safety, and so limit you to monadic operations without the safety of static languages. It also makes the mistake of asserting that, because dynamic languages lack enforced types, the definition of a monad is different in those languages is different. But the definition of a monad is the same -- and includes the Monad Laws as well as the signatures of the bind and return (or fmap and join) functions -- independent of language. And the monad laws -- which even Haskell can't enforce for user-defined monads -- are just as important to correct monad use as the type signatures of the bind/return functions. Enforcement of essential properties is useful, but its not essential to productive use as the use of Monads in Haskell itself demonstrates.

Its manifestly clear that productive programming without type safety is possible, and I don't see anything there that distinguishes why that would be less true with monads.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: