Re: Why not allow empty record updates?

2011-11-15 Thread Edward Kmett
Sent from my iPad On Nov 15, 2011, at 7:18 PM, wren ng thornton wrote: > On 11/15/11 12:33 PM, Yitzchak Gale wrote: >> Simon Peyton-Jones wrote: >> Trouble is, what type does this have? >> f x = x {} >> >> Malcolm Wallace wrote: > f :: a -> a >> >> Ian Lynagh wrote: That

Re: Why not allow empty record updates?

2011-11-15 Thread wren ng thornton
On 11/15/11 12:33 PM, Yitzchak Gale wrote: Simon Peyton-Jones wrote: Trouble is, what type does this have? f x = x {} Malcolm Wallace wrote: f :: a -> a Ian Lynagh wrote: That wouldn't help the original poster, as it is incompatible with f :: Foo Clean -> Foo Dirty Only because in t

RE: instance union proposal

2011-11-15 Thread Simon Peyton-Jones
Serge I'm afraid I don't really follow your proposal in detail, but I think it may be a version of the proposal described here http://hackage.haskell.org/trac/ghc/wiki/DefaultSuperclassInstances Perhaps you could see if the design there would meet your goals. Simon | -Original Mess

Re: Why not allow empty record updates?

2011-11-15 Thread wagnerdm
Quoting Yitzchak Gale : Yes. The translation of record updates given in the Report makes perfect sense for {}. It is only forbidden by "n >= 1", but no reason is given for that restriction. It doesn't make sense to me. The translation explodes a value into a case statement over its construct

Re: Why not allow empty record updates?

2011-11-15 Thread Yitzchak Gale
Simon Peyton-Jones wrote: Trouble is, what type does this have?   f x = x {} Malcolm Wallace wrote: >>> f :: a -> a Ian Lynagh wrote: >> That wouldn't help the original poster, as it is incompatible with >> f :: Foo Clean -> Foo Dirty Only because in that expression the type of x is no

Re: source/build separation

2011-11-15 Thread David Brown
On Tue, Nov 15, 2011 at 04:47:18PM +, Simon Marlow wrote: You could do all this with git clones, but it would mean extra shuffling of patches around. If you're happy with that, then that's fine - use whatever scheme you're more comfortable with. There's a script in git's contrib director

Re: source/build separation

2011-11-15 Thread Simon Marlow
On 15/11/2011 10:21, Rustom Mody wrote: I am building ghc from source. The building page http://hackage.haskell.org/trac/ghc/wiki/Building/Using#Sourcetreesandbuildtrees mentions lndir for separating source trees from build trees. Given how much detail is generally given for individual commands

RE: Why not allow empty record updates?

2011-11-15 Thread Simon Peyton-Jones
| > > Trouble is, what type does this have? | > > | > > f x = x {} | > | > f :: a -> a | | That wouldn't help the original poster, as it is incompatible with | f :: Foo Clean -> Foo Dirty Ah! *That* is why I said it was awkward. Thanks Ian. Simon ___

RE: Why not allow empty record updates?

2011-11-15 Thread Simon Peyton-Jones
Hmm yes. Fair enough. Does anyone care enough? I can see (now) that it wouldn't really be hard. | -Original Message- | From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users- | boun...@haskell.org] On Behalf Of Yitzchak Gale | Sent: 15 November 2011 11:16 | To: Ma

Re: Why not allow empty record updates?

2011-11-15 Thread Ian Lynagh
On Tue, Nov 15, 2011 at 08:34:01AM +, Malcolm Wallace wrote: > > On 14 Nov 2011, at 22:09, Simon Peyton-Jones wrote: > > > Trouble is, what type does this have? > > > > f x = x {} > > f :: a -> a That wouldn't help the original poster, as it is incompatible with f :: Foo Clean -> Foo D

Re: Why not allow empty record updates?

2011-11-15 Thread Yitzchak Gale
Simon Peyton-Jones wrote: >> Trouble is, what type does this have? >>       f x = x {} Malcolm Wallace wrote: > Empty record patterns {} are permitted, even for types > that are not declared with named fields. > So I don't see why an empty record update should > require the type to be declared wit

source/build separation

2011-11-15 Thread Rustom Mody
I am building ghc from source. The building page http://hackage.haskell.org/trac/ghc/wiki/Building/Using#Sourcetreesandbuildtrees mentions lndir for separating source trees from build trees. Given how much detail is generally given for individual commands eg http://hackage.haskell.org/trac/ghc/wi

Re: Why not allow empty record updates?

2011-11-15 Thread Malcolm Wallace
On 14 Nov 2011, at 22:09, Simon Peyton-Jones wrote: > Trouble is, what type does this have? > > f x = x {} f :: a -> a Empty record patterns {} are permitted, even for types that are not declared with named fields. So I don't see why an empty record update should require the type to b