> …it is common to say 'data type X is a monad'. This statement is completely nonsensical…
I think the reason for this is that in Haskell we model algebraic structures using typeclasses, which are dispatched by type. So we say “X is a monoid, with mempty and mappend defined as follows”:
instance Monoid X where
mempty = …
mappend = …
Instead of “X, emptyX, and appendX form a monoid”:
I think the reason for this is that in Haskell we model algebraic structures using typeclasses, which are dispatched by type. So we say “X is a monoid, with mempty and mappend defined as follows”:
Instead of “X, emptyX, and appendX form a monoid”: This leads to what I call the “newtype hack” for distinguishing different monoids (resp. monads, &c.) on the same underlying type.