Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-07 Thread Manuel M T Chakravarty
Alexey Rodriguez: On Fri, Jul 4, 2008 at 5:03 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: The problem is that blah's type is ambiguous, as f does only occur as an argument to the type family. If you'd define class Blah f a where blah :: a - f - T f f a (and change the rest

Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-04 Thread Alexey Rodriguez
On Fri, Jul 4, 2008 at 5:03 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: The problem is that blah's type is ambiguous, as f does only occur as an argument to the type family. If you'd define class Blah f a where blah :: a - f - T f f a (and change the rest of the program

[Haskell-cafe] Type families versus functional dependencies question

2008-07-03 Thread Alexey Rodriguez
Hi guys, We are having trouble with the following program that uses type families: class Blah f a where blah :: a - T f f a class A f where type T f :: (* - *) - * - * the following function does not type: wrapper :: forall a f . Blah f a = a - T f f a wrapper x = blah x GHC gives

Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-03 Thread Claus Reinke
GHC gives the error: Couldn't match expected type `T f1 f1 a' against inferred type `T f f a' In the expression: blah x In the definition of `wrapper': wrapper x = blah x actually, GHC gives me could not deduce Blah f a from Blah f1 a first. It seems that desugaring type

Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-03 Thread Alexey Rodriguez
On Thu, Jul 3, 2008 at 7:31 PM, Claus Reinke [EMAIL PROTECTED] wrote: GHC gives the error: Couldn't match expected type `T f1 f1 a' against inferred type `T f f a' In the expression: blah x In the definition of `wrapper': wrapper x = blah x actually, GHC gives me could not

Re: [Haskell-cafe] Type families versus functional dependencies question

2008-07-03 Thread Manuel M T Chakravarty
Alexey Rodriguez: We are having trouble with the following program that uses type families: class Blah f a where blah :: a - T f f a class A f where type T f :: (* - *) - * - * the following function does not type: wrapper :: forall a f . Blah f a = a - T f f a wrapper x = blah x