Hi,
Am Montag, den 16.09.2013, 05:53 + schrieb Simon Peyton-Jones:
a) A newtype can be casted only if its constructor is visible.
b) Casting below a type constructor (instance Coercible a b = Coercible
(Maybe a) (Maybe b)) is possible if the roles allow it; the
constructor
Very cool!
In the feature as pushed, is it possible to use coerce on any old newtype? If
so, then it really is a language feature and probably should go into the
manual, if `coerce` is exposed.
What was the end result of the discussion on abstraction? Can a library control
how its types are
Hi,
Am Sonntag, den 15.09.2013, 16:48 -0400 schrieb Richard Eisenberg:
What was the end result of the discussion on abstraction? Can a
library control how its types are coerced?
there is no end result, as this is just a language feature. But the
current state of affairs is that:
* A newtype
Because, from a user's point of view, defining
newtype Age = MkAge Int
automatically creates Coercible instances
instance Coercible Age Int
instance Coercible Int Age
and defining datatypes also creates instances. This looks like a user-visible
language feature to me, and I think it
Hi,
Am Sonntag, den 15.09.2013, 17:24 -0400 schrieb Richard Eisenberg:
Because, from a user's point of view, defining
newtype Age = MkAge Int
automatically creates Coercible instances
instance Coercible Age Int
instance Coercible Int Age
and defining datatypes also creates
On Sep 15, 2013, at 5:44 PM, Joachim Breitner m...@joachim-breitner.de wrote:
not really; if you type :info Coercible you see that there are no
instances created. Just the type-checking of uses of coerce is a bit
special.
Even stranger, I think. I understand that there aren't really any
Great -- that makes a lot of sense to me. Sorry if you had to repeat yourself
here.
Does this mean that it is impossible to coerce a (Map String Int) to a (Map
String Age) in Safe code? I expect so. I think this is suboptimal, but there
might be a small way to patch this small weakness in the
Hi,
Am Sonntag, den 15.09.2013, 17:49 -0400 schrieb Richard Eisenberg:
To be clear, I'm not asking for an explanation for me -- I think I
know what's going on here.
Sorry if you got that impression; I have no doubt that you understand
the feature (possibly better than me!)
I just think that
and David even want (c)/(3) for Safe Haskell!
Simon
| -Original Message-
| From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Richard
| Eisenberg
| Sent: 15 September 2013 22:57
| To: Joachim Breitner
| Cc: ghc-devs@haskell.org
| Subject: Re: Coercible class
Richard raises a question about coherence below. (Coherence, not soundness.)
But it's a coherence problem we already have. Given his Foo type,
| data Foo a where-- a's role is representational; this is NOT a GADT
| MkFoo :: Ord a = a - Foo a
suppose we define
bar ::
instances of it (c) look in the user
manual.
Simon
| -Original Message-
| From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Joachim
| Breitner
| Sent: 15 September 2013 22:57
| To: ghc-devs@haskell.org
| Subject: Re: Coercible class (Was: newtype wrappers)
|
| Hi
Hi,
Am Montag, den 09.09.2013, 11:26 -0500 schrieb Austin Seipp:
It sounds like Simon thinks your work is good to go, so when your tree
is clean, feel free to push.
done!
Given that in the final form the feature, to the user, looks like a
library and not a language extension, I decided to put
12 matches
Mail list logo