2011/3/22 Daniel Schüssler <[email protected]>:
> Hello,
>
> turns out that you can define the group operation of the symmetric group on 3
> elements in this abstract way (via the isomorphism to the group of bijective
> functions from a three-element type to itself):
>
>        s3mult g2 g1 = fromFun (toFun g2 . toFun g1)
>
> and convince GHC to compile it down to a nested case statement. It even
> somehow made the left multiplication with the identity non-strict. Just
> thought it's neat ;)
>

That's quite fantastic.

Antoine

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to