4 ms·
You’re right that there’s not much to monoids. Though much hay has been made about monads, they barely rate having a name either, and you’d be surprised if they
by gbacon 9y ago
You’re right that there’s not much to monoids. Though much hay has been made about monads, they barely rate having a name either, and you’d be surprised if they didn’t work the way they do.
That being said, they are useful abstractions and in Haskell, for example, open up all of Control.Monad[0] and Data.Monoid[1] to your code for free.
[0]: https://hackage.haskell.org/package/base-4.10.0.0/docs/Control-Monad.html https://hackage.haskell.org/package/base-4.10.0.0/docs/Contr...
[1]: https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Monoid.html https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-...