Derived Functor instance for void types

David Feuer david.feuer at
Sun Jan 15 19:37:51 UTC 2017

Currently, if you write

data V a deriving Functor

GHC generates

fmap _ _ = error "Void fmap"

This seems quite unfortunate, because it loses potentially useful error

fmap (+ 3) (error "Too many snozzcumbers!")

throws "Void fmap", rather than the much more precise "Too many
snozzcumbers!" I've opened Trac #13117 to fix this, but I figured I should
double check that no one is opposed.

David Feuer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list