Derived Functor instance for void types

Kevin Cotrone kevincotrone at gmail.com
Mon Jan 16 04:00:03 UTC 2017


That seems to have a surprising strictness.

I'm not sure if it would be the best idea to try and evaluate a type with
no inhabitants.

On Sun, Jan 15, 2017 at 2:37 PM, David Feuer <david.feuer at gmail.com> wrote:

> 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
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170115/dd3ad8f9/attachment.html>


More information about the Libraries mailing list