
4 Jan
2010
4 Jan
'10
6:15 p.m.
On Mon, Jan 4, 2010 at 3:01 PM, Derek Elkins
Ignoring bottoms the free theorem for fmap can be written:
If h . p = q . g then fmap h . fmap p = fmap q . fmap g
When I play with http://haskell.as9x.info/ft.html I get examples that look more like: If fmap' has the same signature as the usual fmap for a type and h . p = q . g then fmap h . fmap' p = fmap' q . fmap g
From which it follows that if fmap' id = id then fmap' is fmap.
But I don't know how to prove that uniformly for all types, just the ones I generated free theorems for. -- Dan