Another place this problem has come up for me is in wanting to ensure
representation sharing for values constructed by data constructors which
don't make use of their type parameters. A trivial example would be sharing
the representation of Nothing between all the Maybe types, or sharing the
I wrote:
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.
d wagner wrote:
It doesn't make sense to me. The translation explodes a value into a case
statement over its
| 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
There are several different things going on in this thread.
1.
On 11/15/11 8:07 PM, wagne...@seas.upenn.edu wrote:
Quoting wren ng thornton w...@freegeek.org:
So far I've just defined helper functions to adjust the phantom
type[1], each of which is implemented by (\x - x { foo = foo x }).
It's a horrible hack, but at least it's hidden away in library
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 with named
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 Dirty
| To: Malcolm Wallace
| Cc: GHC-users List
| Subject: Re: Why not allow empty record updates?
|
| 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
| 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
___
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 not known.
Quoting Yitzchak Gale g...@sefer.org:
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
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
Sent from my iPad
On Nov 15, 2011, at 7:18 PM, wren ng thornton w...@freegeek.org 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 wouldn't help
Hello GHC HQ,
I have been toying with phantom types in combination with polymorphic
record-updates (which is a great feature imho), but stumbled over a
limitation: GHC doesn't allow empty record updates (see toy example
below), and I couldn't find a GHC language extension to relax this
-
| boun...@haskell.org] On Behalf Of Herbert Valerio Riedel
| Sent: 14 November 2011 14:31
| To: glasgow-haskell-users@haskell.org
| Subject: Why not allow empty record updates?
|
| Hello GHC HQ,
|
| I have been toying with phantom types in combination with polymorphic
| record-updates (which
14 matches
Mail list logo