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

1. Most lines of code don't require side-effects, the Haskell way just asks you to structure your program in pure parts and side effecting parts (usually 90/10). 2. Also it's easy to define your own forms of side effects and parameterize your code on them (so I write my code to depend on any monad m that offers references and the code runs using IO, ST or STM), not being constrained by whatever choices the language designers gave you initially 3. Monads (and arrows and other abstractions that can model side-effects) are beautiful by themselves. It's one of the most elegant ways to express, compose and restrict side-effects. In most languages there's no easy way to create different combinators to deal with side-effects, but in Haskell 'do', ';' and '<-' are only pieces of notation, the real meat is '>>=' and 'return' and whatever combinators you build upon these. 4. The Haskell way to deal with side effects is to use a pure language to build a side-effecting program. Instead of writing down the program you abstract its parts and use combinators to mix them. 'IO' is a value that can be manipulated not an action that was already executed.



Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: