Re: Functional dependencies can return kinds, type families cannot

2014-02-13 Thread Richard Eisenberg
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?...

RE: Functional Dependencies

2005-08-17 Thread Simon Peyton-Jones
| 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.

Re: Functional Dependencies

2005-08-17 Thread Dirk Reckmann
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

Re: Functional Dependencies

2005-08-16 Thread 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? Keean. Dirk Reckmann wrote: Am Donnerstag, 11. August 2005 11:41 schrieb Simon Peyton-Jones:

Re: Functional Dependencies

2005-08-16 Thread Dirk Reckmann
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

Re: Functional Dependencies

2005-08-16 Thread 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 a little): {-# OPTIONS -fglasgow-exts

Re: Functional Dependencies

2005-08-15 Thread Dirk Reckmann
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

RE: Functional Dependencies

2005-08-11 Thread 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 f, because we can see that 'a' *must be* Bool, so it's a bit

Re: Functional dependencies, principal types, and decidable typechecking

2005-04-06 Thread Keean Schupke
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

Re: Functional dependencies, principal types, and decidable type checking

2005-04-05 Thread Manuel M T Chakravarty
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

RE: Functional dependencies, principal types, and decidable typechecking

2005-04-05 Thread Simon Peyton-Jones
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 |

RE: Functional dependencies, principal types, and decidable typechecking

2005-04-05 Thread Manuel M T Chakravarty
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

Re: Functional dependencies, principal types, and decidable type checking

2005-04-03 Thread Iavor Diatchki
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,

RE: functional dependencies - bug?

2002-07-01 Thread Simon Peyton-Jones
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