
22 Mar
2011
22 Mar
'11
9:13 p.m.
2011/3/22 Daniel Schüssler
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