Hello,
I largely don't know what I'm doing or even trying to do, it is a voyage into
the unknownbutif I go...
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
class Foo x y | x -
The constraint on an instance never influences which instance is
selected. So as far as instance selection goes, 'instance Foo x' and
'instance C x = Foo x' are the same. The constraint is only checked
after the instance is selected.
Erik
On Fri, Jul 5, 2013 at 2:43 PM, Nicholls, Mark
You're running into the open worldassumption--anybody could come along
and make Integer part of your NotAnInteger class, and there's nothing you
can do to stop them. This is a design tradeoff for typeclasses: typeclass
instances are always global and are exported to all other modules you use.
This
London NW1 8TT | e:
nicholls.m...@vimn.commailto:m...@vimn.com T: +44 (0)203 580 2223
[Description: cid:image001.png@01CD488D.9204D030]
From: Tikhon Jelvis [mailto:tik...@jelv.is]
Sent: 05 July 2013 2:08 PM
To: Nicholls, Mark
Cc: haskell-cafe
Subject: Re: [Haskell-cafe] newbie question about
I have defined a function on types thanks to functional dependencies.
I use it like that:
myFunction :: (TypeFunction MyComplexType f) = f - f
f is unique for MyComplexType. Is there a way to name f ?
I would like to write:
myFunction :: SimplifiedType - SimplifiedType
where
TypeFunction
[EMAIL PROTECTED]:
[...] The above two instances show there
exists a model of T where the functional dependency is
violated. That's why both GHC 6.4 and Hugs reject the instance. Again,
it is a mystery why GHC 6.6 accepts it.
Actually, GHC 6.6 does reject cases like the one discussed in this
Hi,
I am trying to do something like the following:
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
module TestCase where
data Any root = forall pos sel . T root pos sel = ANY pos
class T root pos sel | pos - root, root - sel where
f :: pos - sel - Bool
instance T root
Of Jean-
| Marie Gaillourdet
| Sent: 26 March 2007 10:53
| To: haskell-cafe@haskell.org
| Subject: [Haskell-cafe] A question about functional dependencies and
existential quantification
|
| Hi,
|
| I am trying to do something like the following:
|
| {-# OPTIONS -fglasgow-exts -fallow-undecidable
Hi,
thanks for your quick answer. Do you have any predictions when System
F_c in GHC will be available for usage?
Regards,
Jean-Marie
Simon Peyton-Jones wrote:
What you want to do is perfectly reasonable -- but it cannot be translated
into System F and that's why GHC rejects it.
GHC now
| thanks for your quick answer. Do you have any predictions when System
| F_c in GHC will be available for usage?
Somewhere between 2 and 4 months is my guess
Simon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Jean-Marie Gaillourdet wrote
I am trying to do something like the following:
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
module TestCase where
data Any root = forall pos sel . T root pos sel = ANY pos
class T root pos sel | pos - root, root - sel where
f :: pos
11 matches
Mail list logo