[Haskell-cafe] Field types

Brandon Allbery allbery.b at gmail.com
Mon Sep 20 17:17:13 UTC 2021


Unless something has changed very recently, the latter is illegal.

On Mon, Sep 20, 2021 at 1:14 PM David Feuer <david.feuer at gmail.com> wrote:

> Does one field name for one datatype always refer to a field with the same
> type? Or is there some wacky extension that would allow things like
>
> data Foo
>   = Bar { zoom :: Int }
>   | Baz { zoom :: Char }
>
> I'm hoping I don't have to worry about the latter possibility....
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210920/48d5e4d1/attachment.html>


More information about the Haskell-Cafe mailing list