Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The IO monad (a particular instance) is an abstract data type (not an Algebraic data type, by the way).

Other monads (e.g: the State monad from Control.Monad.Trans.State) are not abstract data types (or algebraic for that matter).

Specifically, for something to be an "abstract data type", it must not expose its internal representation, but only relevant operations. IO is indeed such an abstract data type which happens to be a Monad instance. State and [] are monads that do expose their internal representation: ergo, they aren't abstract data types.

You seem to be confusing algebraic and abstract data types (different things!) and taking a statement about a specific monad instance (IO) as if it was about the general concept of Monads (it's not).



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

Search: