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

2008-07-06 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 r

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 prog

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

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 gi

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 fu

[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