> 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 th
On 11/15/11 8:07 PM, wagne...@seas.upenn.edu wrote:
Quoting wren ng thornton :
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
functions instead of s
| >> 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 thing
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 c
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
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
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
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
| > > 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
___
| 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
| > tha
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
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
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
users-
| 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"
|
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
constrain
15 matches
Mail list logo