DEV Community

Discussion on: Is Haskell bad for FP?

Collapse
 
drbearhands profile image
DrBearhands

You're right, I had the wrong definition of purity and side-effects.

Nevertheless, the intuition remains. By allowing errors to be based on ⊥, types in Hask become less informative than they would be in just the Set category extended with infinite recursion (let's call it Set∞). Essentially it is much like using a Kleisli category of Set∞ with monad Either Error. This is very similar to what you get when allowing side-effects, which use the IO monad instead.

My confusion came from incorrectly thinking that a side-effect was anything not properly represented in the type system, and purity merely means "no side-effects".