18 ms·
Why would it be a stretch? (I've never been exposed to Haskell before.)
by bendmorris 16y ago
Why would it be a stretch? (I've never been exposed to Haskell before.)
- Zak 16y agoUI operations, and IO in general tend to feel a bit out of place in Haskell. It often feels like you're trying to trick the compiler in to accepting your program instead of just saying what you mean. That said, if you can cleanly separate logic and presentation in your code, it might not be too bad.
- danieldk 16y agoActually, 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.