On 21 Dec 2011, at 14:07, Erik Hesselink <hessel...@gmail.com> wrote:

On Wed, Dec 21, 2011 at 14:10, Bas van Dijk <v.dijk....@gmail.com> wrote:

 The semantics of Maybe are

clear: it's failure-and-prioritized-choice.

Are you sure?

Yes.

There are (at least) four Monoid instances for Maybe
[1]. With a direct instance for Maybe and its Dual you have only
covered two.

Types don't just give data a representation: types evoke structure. The data stored by Maybe can be made into a monoid in several ways, but the failure-management role of Maybe makes just one of them appropriate.

Cheers

Conor



Erik

[1] https://byorgey.wordpress.com/2011/04/18/monoids-for-maybe/

_______________________________________________
Libraries mailing list
librar...@haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to