[Haskell-beginners] Expressing the idea of a group in Haskell

Patrick LeBoutillier patrick.leboutillier at gmail.com
Wed Mar 16 13:41:25 CET 2011


Hi,

Math newbie here: what's the difference between a group and a monoid?

Patrick


On Wed, Mar 16, 2011 at 4:49 AM, Christian <ch.gosch at googlemail.com> wrote:
> Hello Haskell-Experts!
> I was trying to express the notion of a (mathematical) group
> in Haskell, using type classes, as an exercise.
> If I am not mistaken, a group can be for example the Reals together with
> the multiplication operation and "1" as the neutral element.
> Or, the Reals with addition and "0".
> my first idea was to write something like
>
>  class Group a where
>   ...
>
> _but_, I thought, I need to parameterise, so to speak, not only using the
> type "a", but also the group operation.
> How could I do that in Haskell? Is that even possible?
>
> Thanks in advance!
> Christian
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



-- 
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada



More information about the Beginners mailing list