
23 Dec
2009
23 Dec
'09
3:58 p.m.
Am Mittwoch 23 Dezember 2009 14:40:46 schrieb slemi:
i dont know any calculus-thingy, this is what i did:
reMatr a = Matr . a . unMatr reMatr a = Matr . (. unMatr) a reMatr a = Matr . (flip (.) unMatr) a
You need to be aware of the implicit parentheses, that is Matr . ((flip (.) unMatr) a) or (.) Matr ((flip (.) unMatr) a) = ((.) Matr) ((flip (.) unMatr) a) = f (g x), with f = (.) Matr g = flip (.) unMatr x = a Now f (g x) = (f . g) x and you're done. But as Kim-Ee Yeoh pointed out, if you're pointfreeing, give type signatures, or the monomorphism restriction is going to surprise you some time.
reMatr = Matr . (flip (.) unMatr)