On Tue, Feb 7, 2012 at 7:23 AM, Mikhail Vorozhtsov
mikhail.vorozht...@gmail.com wrote:
Even better, you can write
type ExistentialWith c e = (Existential e, c ~ ConstraintOf e)
instead of
class (Existential e, c ~ ConstraintOf e) = ExistentialWith c e
instance (Existential e, c ~
Are there documentation on constraints being types, how they can be
declared/handled and what are the interests?
2012/2/7 Mikhail Vorozhtsov mikhail.vorozht...@gmail.com
On 02/06/2012 03:32 AM, Gábor Lehel wrote:
There's a common pattern in Haskell of writing:
data E where E :: C a = a -
On 02/07/2012 06:49 PM, Yves Parès wrote:
Are there documentation on constraints being types, how they can be
declared/handled and what are the interests?
The GHC User's Guide has (somewhat short) section
http://www.haskell.org/ghc/docs/latest/html/users_guide/constraint-kind.html
Blog posts:
On 02/07/2012 04:05 PM, Gábor Lehel wrote:
On Tue, Feb 7, 2012 at 7:23 AM, Mikhail Vorozhtsov
mikhail.vorozht...@gmail.com wrote:
Even better, you can write
type ExistentialWith c e = (Existential e, c ~ ConstraintOf e)
instead of
class(Existential e, c ~ ConstraintOf e) =
2012/2/7 Mikhail Vorozhtsov mikhail.vorozht...@gmail.com:
Ah, sorry, I got sloppy. Have you encountered situations where partial
application of such constraint aliases becomes a problem?
In the particular case of the Existential class I'm not sure (it's
hard to imagine a real-world application
Hi,
Gábor Lehel wrote:
data E = forall a. C a = E a
I don't know if anyone's ever set out what the precise requirements
are for a type class method to be useful with existentials.
More than you seem to think. For example:
data Number = forall a . Num a = Number a
foo :: Number - Number
If anyone ever says, I'd really like to use your package if it
weren't for the dependencies, I'll very gladly remove them. (They're
used for actual instances, by the way, not just the Defaults module.)
2012/2/6 Yves Parès yves.pa...@gmail.com:
That is a great initiative.
I didn't know about
2012/2/6 Tillmann Rendel ren...@informatik.uni-marburg.de:
Hi,
Gábor Lehel wrote:
data E = forall a. C a = E a
I don't know if anyone's ever set out what the precise requirements
are for a type class method to be useful with existentials.
More than you seem to think. For example:
On 02/06/2012 03:32 AM, Gábor Lehel wrote:
There's a common pattern in Haskell of writing:
data E where E :: C a = a - E
also written
data E = forall a. C a = E a
I recently uploaded a package to Hackage which uses the new
ConstraintKinds extension to factor this pattern out into an Exists
There's a common pattern in Haskell of writing:
data E where E :: C a = a - E
also written
data E = forall a. C a = E a
I recently uploaded a package to Hackage which uses the new
ConstraintKinds extension to factor this pattern out into an Exists
type parameterized on the constraint, and also
That is a great initiative.
I didn't know about those Kind extensions that enable you to pass a
typeclass as a type parameter...
However, have you considered putting the Data.Exists.Default module in a
separate package? That would reduce the dependencies for those who just
need Exists and
11 matches
Mail list logo