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

Ashley Yakeley ashley at semantic.org
Tue Jan 3 17:41:40 EST 2006


David Roundy wrote:
> On Mon, Jan 02, 2006 at 04:23:32PM -0800, Ashley Yakeley wrote:
> 
>>>One open question (in my mind) would be whether we'd allow
>>>
>>>data Foo = FooInt { foo :: Int } | FooChar { foo :: Char }
>>>
>>>In the "new" system, there's no reason this need be illegal.
>>
>>How would this behave?
>>
>>  data Foo a b = FooA {foo :: a} | FooB {foo :: b}
> 
> 
> I'm not sure I understand the problem.  Why would there be any difficulty
> with this?

What type would "foo" have? And what would that imply for the type of 
"foo" in your Int/Char example?

-- 
Ashley Yakeley



More information about the Haskell mailing list