[Haskell-cafe] Field types

Tom Ellis tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Mon Sep 20 17:17:31 UTC 2021


On Mon, Sep 20, 2021 at 01:13:43PM -0400, David Feuer 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....

Me too!  Under such circumstances what would the type of
field-as-function be?


More information about the Haskell-Cafe mailing list