On Tue, Dec 27, 2011 at 6:47 PM, Bas van Dijk <v.dijk....@gmail.com> wrote:
> On 27 December 2011 17:38, Michael Snoyman <mich...@snoyman.com> wrote:
>> Thanks to Mark Wright for pointing this out[1].
>>
>> We have the equivalent of the following code in persistent:
>>
>> {-# LANGUAGE MultiParamTypeClasses #-}
>> data Key backend entity = Key
>>
>> class Monad (b m) => Foo b m where
>>    func :: b m (Key b m)
>>
>> This code works fine with GHC 7.0, but I get the following message from GHC 
>> 7.4:
>>
>>    Expecting two more arguments to `b'
>>    In the type `b m (Key b m)'
>>    In the class declaration for `Foo'
>>
>> Is this expected behavior, or a bug? If the former, what would be a
>> possible workaround?
>>
>> Thanks,
>> Michael
>>
>> [1] https://github.com/yesodweb/persistent/issues/31
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> I fixed a similar breakage in the hmatrix library:
>
> https://github.com/AlbertoRuiz/hmatrix/commit/a4f38eb196209436f72b938f6355f6e28474bef3
>
> I don't know if it's a bug in GHC, but the workaround is to add an
> explicit kind signature:
>
> {-# LANGUAGE KindSignatures, MultiParamTypeClasses #-}
> data Key (backend :: * -> * -> *) entity = Key
>
> class Monad (b m) => Foo b m where
>   func :: b m (Key b m)
>
> Cheers,
>
> Bas

Thanks Bas, that seems to solve the problem.

Michael

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to