bug (?) in type checking of record update

Ross Paterson ross@soi.city.ac.uk
Tue, 4 Feb 2003 10:14:19 +0000


On Tue, Feb 04, 2003 at 11:00:16AM +0100, Johannes Waldmann wrote:
> wanna see a large Int in hugs? I mean Int, not Integer. 
> the program below gives this nice result:
> 
> Main> contents bug
> 1000000000000000000000000000000 :: Int
> 
> data Container a = 
>      Container   { contents :: a
> 		 , info :: String
> 		 } 
> 
> bug :: Container Int
> bug = let xs = 10^30
> 	  a = Container {  contents = xs , info = "foo" }
>       in  a { info = "bar" }

Definitely a bug in typing of record updates:

Bug> :t Container { contents = True , info = "foo" } { info = "bar" }
Container{contents = True, info = "foo"}{info = "bar"} :: Container a