On Feb 13, 2014, at 4:28 AM, José Pedro Magalhães j...@cs.uu.nl wrote:
The most interesting part here is the functional dependency fs - k, where k
is a kind variable!
If this is not a bug (and it does seem to work as I expect it to), then could
we have type families
return kinds too?...
| class C a b | a - b
| instance C Int Bool
|
| f :: forall a. C Int a = a - a
| f x = x
|
| GHC rejects the type signature for f, because we can see that 'a'
*must
| be* Bool, so it's a bit misleading to universally quantify it.
|
| Ok, maybe this is a reasonable choice.
Am Dienstag, 16. August 2005 19:45 schrieb Iavor Diatchki:
Hello,
I am not sure what GHC is doing, it certainly seems to be
inconsistent. In Hugs both the examples work. In case you are
interested, here is how you can get a version that works in
both Hugs and GHC (I just modified your code
Picked up on this late... I have working examples of add etc under
ghc/ghci...
I can't remeber all the issues involved in getting it working, but I can
post the
code for add if its any use?
Keean.
Dirk Reckmann wrote:
Am Donnerstag, 11. August 2005 11:41 schrieb Simon Peyton-Jones:
Hello Keean!
Am Dienstag, 16. August 2005 13:48 schrieb Keean Schupke:
Picked up on this late... I have working examples of add etc under
ghc/ghci...
I can't remeber all the issues involved in getting it working, but I can
post the
code for add if its any use?
Yes, that would be nice. I'd
Hello,
I am not sure what GHC is doing, it certainly seems to be
inconsistent. In Hugs both the examples work. In case you are
interested, here is how you can get a version that works in
both Hugs and GHC (I just modified your code a little):
{-# OPTIONS -fglasgow-exts
Am Donnerstag, 11. August 2005 11:41 schrieb Simon Peyton-Jones:
You raise a vexed question, which has been discussed a lot. Should this
typecheck?
class C a b | a - b
instance C Int Bool
f :: forall a. C Int a = a - a
f x = x
GHC rejects the type signature for
You raise a vexed question, which has been discussed a lot. Should this
typecheck?
class C a b | a - b
instance C Int Bool
f :: forall a. C Int a = a - a
f x = x
GHC rejects the type signature for f, because we can see that 'a' *must
be* Bool, so it's a bit
Manuel M T Chakravarty wrote:
I accept that this is the process by which GHC computes these types, but
it does violate the principal types property, doesn't it? The relation
Int - () = forall c. Int - c
does not hold.
I realise that principal types and principal typings are slightly
Iavor Diatchki wrote:
Hi,
On Apr 3, 2005 7:33 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote:
Assume the following type class declarations with functional
dependencies:
{-# OPTIONS -fglasgow-exts #-}
class C a b c | a b - c where
foo :: (a, b) - c
instance C a a r
Manuel
Your short program tickles a lot of different questions. Here's an
explanation.
Simon
| Assume the following type class declarations with functional
| dependencies:
Actually much of the behaviour you see happens without fundeps.
| {-# OPTIONS -fglasgow-exts #-}
|
| class C a b c |
Simon Peyton-Jones wrote:
| {-# OPTIONS -fglasgow-exts #-}
|
| class C a b c | a b - c where
| foo :: (a, b) - c
|
| instance C a a r = C a (b, c) r where
|foo (a, (b, c)) = foo (a, a)
You are already on dodgy ground here, because the instance decl doesn't
guarantee that the
Hi,
On Apr 3, 2005 7:33 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote:
Assume the following type class declarations with functional
dependencies:
{-# OPTIONS -fglasgow-exts #-}
class C a b c | a b - c where
foo :: (a, b) - c
instance C a a r = C a (b, c) r where
foo (a,
Christian
This is clearly a bug in 5.03.
However, it works fine in the (about to be released) 5.04.
My plan, therefore, is to add it to our regression test suite
and delcare victory. If I was being totally thorough I'd find
out what went wrong in 5.03, in case it's still wrong in 5.04, but
14 matches
Mail list logo