[Haskell-cafe] Comments from OCaml Hacker Brian Hurt
Andrew Wagner
wagner.andrew at gmail.com
Thu Jan 15 16:03:55 EST 2009
I think perhaps the correct question here is not "how many instances of
Monoid are there?", but "how many functions are written that can use an
arbitrary Monoid". E.g., the fact that there are a lot of instances of Monad
doesn't make it useful. There are a lot of instances of Monad because it's
useful to have instances of Monad. Why? Because of
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html !
Look at all the cool stuff you can automagically do with your type just
because it's an instance of Monad! I think that's the point. What can you do
with arbitrary Monoids? Not much, as evidenced by
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Monoid.html
On Thu, Jan 15, 2009 at 3:51 PM, Don Stewart <dons at galois.com> wrote:
> duncan.coutts:
> > On Thu, 2009-01-15 at 19:46 +0000, Andrew Coppin wrote:
> >
> > > PS. As a small aside... Is the Monoid class actually used *anywhere* in
> > > all of Haskell?
> >
> > Yes.
> >
> > They're used quite a lot in Cabal. Package databases are monoids.
> > Configuration files are monoids. Command line flags and sets of command
> > line flags are monoids. Package build information is a monoid.
> >
> > It is also used in the Foldable class which is a nice interface for
> > traversing/visiting structures. Binary serialisation is also a monoid.
>
> Also, xmonad configuration hooks are monoidal. So all those xmonad users
> gluing together keybindings are using the Monoid class.
>
> -- Don
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090115/7a1ac9a3/attachment.htm
More information about the Haskell-Cafe
mailing list