$\newcommand{\defeq}{\mathrel{\mathop:}=}$

## 2008/08/05

### Red-Blooded

scm 老師給的 reference：Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell by Simon Peyton Jones。Tutorial 的開場白有一段

The bottom line is that laziness and side effects are, from a practical point of view, incompatible. If you want to use a lazy language, it pretty much has to be a purely functional language; if you want to use side effects, you had better use a strict language.

For a long time this situation was rather embarrassing for the lazy community: even the input/output story for purely-functional languages was weak and unconvincing, let alone error recovery, concurrency, etc. Over the last few years, a surprising solution has emerged: the monad. I say "surprising" because anything with as exotic a name as "monad" — derived from category theory, one of the most abstract branches of mathematics — is unlikely to be very useful to red-blooded programmers. [...]

--

Labels: