Mutability / side effects

I’m a bit confused. Doesn’t abstraction mean that the definition is hidden and inaccesible? Why would a definition of IO via the FFI like that count as an abstraction?

As per the usual definition of abstraction in Haskell, the IO type is abstract in the sense that its definition is only exported from internal modules (although those are annoyingly not obviously marked as such).

If you want proper abstractions, I would suggest using backpack and writing everything as modules that are parameterized over an IO signature.

2 Likes