News for hackers. Stuff that matters.
Re:Ask HN: Good languages for closed-source desktop apps by danieldk on Saturday October 02, 2010 @08:34PM (#1751746)
Actually, I think I/O is really clear in Haskell. Haskell is a pure functional language, and in that world side-effects are not possible (since a function should always return the same value, given the same input). For this reason functional languages like Haskell introduce monads, which allow you to model imperative languages (with state and order). I/O is performed in one such monad (the IO monad), and programming in the IO monad just looks like imperative programming. The tricky part is that you cannot get pure values out of the IO monad (since it is impure), which may entice programmers to let the IO monad 'leak' intro programs to much, rather than lifting pure functions into the monad.

Yes, monads can be hard to get in the beginning, but they never felt like tricking the compiler to me.

There are no comments on this comment yet.