[Haskell] Re: (small) records proposal for Haskell '06

John Meacham john at repetae.net
Wed Jan 4 18:03:40 EST 2006

On Wed, Jan 04, 2006 at 08:55:39AM -0500, David Roundy wrote:
> Ah, good point, I hadn't thought about that.  My proposal was to keep
> record updates which would indeed mean that we'd need to require that all
> "foo"s in a given data type have the same type.  Which I don't think is a
> bad thing either... it just hadn't occurred to me.

The issue is with multiple data types that have the same field name, not
the same field reused within a data type. for instance

data Foo = Foo { foo :: Int }
data Bar = Bar { foo :: Int }

f x = x { foo = 4 }

what type does f have?

f :: Foo -> Foo
f :: Bar -> Bar


John Meacham - ⑆repetae.net⑆john⑈ 

More information about the Haskell mailing list