
17 Jan
2009
17 Jan
'09
8:28 a.m.
Hello Luke, Saturday, January 17, 2009, 3:16:06 PM, you wrote:
fmap id = id fmap (f . g) = fmap f . fmap g
The first property is how we write "preserving underlying structure", but this has a precise, well-defined meaning that we can say a given functor obeys or it does not (and if it does not, we say that it's a bad instance). But you are correct that Haskell does not allow us to require proofs of such properties.
not haskell itself, but QuickCheck allows. we may even consider lifting these properties to the language level -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com