RE: Type checker too lazy

2000-12-19 Thread Simon Peyton-Jones
llent report. Simon | -Original Message- | From: Volker Stolz [mailto:[EMAIL PROTECTED]] | Sent: 13 December 2000 08:29 | To: [EMAIL PROTECTED] | Subject: Type checker too lazy | | | Consider the following record (yes, I know, we all hate records but | I use them frequently for read-onl

Re: Type checker too lazy

2000-12-13 Thread Malcolm Wallace
> data Record = R { > blub :: Foo a => a -> [a] > } Wouldn't the pure-Haskell'98 definition data Foo a => Record a = R { blub :: a -> [a] } work as well, if not better? Certainly, ghc accepts both of > print (bar (3::Int)) -- works! > print ((blub r) (3::Int)) --

Type checker too lazy

2000-12-13 Thread Volker Stolz
Consider the following record (yes, I know, we all hate records but I use them frequently for read-only data): > import IO > > class Foo a where > bar :: a -> [a] > > instance Foo Int where > bar x = replicate x x > > data Record = R { > blub :: Foo a => a -> [a] > } > > main = d