[Haskell-cafe] Comments from OCaml Hacker Brian Hurt

Cale Gibbard cgibbard at gmail.com
Thu Jan 15 18:41:25 EST 2009

2009/1/15 Andrew Coppin <andrewcoppin at btinternet.com>:
> OK, well then my next question would be "in what say is defining
> configuration files as a monoid superior to, uh, not defining them as a
> monoid?" What does it allow you to do that you couldn't otherwise? I'm not
> seeing any obvious advantage, but you presumably did this for a reason...

I can't speak from the perspective of the Cabal developers, but
combining configurations with partial information using a monoid
operation is generally a good way to structure things. Basically, this
would be analogous to the way that the First monoid (or the Last
monoid) works, but across a number of fields. You have an empty or
default configuration which specifies nothing that serves as the
identity, and then a way of layering choices together, which is the
monoid operation.

 - Cale

More information about the Haskell-Cafe mailing list