Derived Functor instance for void types

David Feuer david.feuer at gmail.com
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
information:

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: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20170115/2be02bfc/attachment.html>


More information about the Glasgow-haskell-users mailing list