DefaultSignatures and MultiParamTypeClasses

Reiner Pope reiner.pope at gmail.com
Mon Jan 16 23:42:53 CET 2012


I thought that might be the case. Thanks for that!

Cheers,
Reiner

On 17/01/2012, at 1:15 AM, Simon Peyton-Jones wrote:

> | /tmp/Test.hs:4:1:	
> |     The multi-parameter class `C' cannot have generic methods
> |     In the class declaration for `C'
> 
> Aha.  Trawling the commit logs, this test is simply a vestige of the PREVIOUS generic-class story, now long gone.  So we can lift the restriction easily.
> 
> I'll commit a patch shortly; I hope it'll be in time for 7.4
> 
> Simon
> 
> | -----Original Message-----
> | From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-
> | users-bounces at haskell.org] On Behalf Of Reiner Pope
> | Sent: 16 January 2012 05:32
> | To: glasgow-haskell-users at haskell.org
> | Subject: DefaultSignatures and MultiParamTypeClasses
> | 
> | Hi all,
> | 
> | I just tried, and it appears that the new DefaultSignatures extension doesn't
> | work with multi parameter type classes. For example, when I compile this
> | file:
> | 
> | ----
> | {-# LANGUAGE DefaultSignatures, MultiParamTypeClasses #-}
> | module Test where
> | 
> | class C a b where
> |   conv :: a -> b
> | 
> |   default conv :: D a b => a -> b
> |   conv = dconv
> | 
> | class D a b where
> |   dconv :: a -> b
> | -----
> | 
> | I get the error message:
> | 
> | -----
> | /tmp/Test.hs:4:1:	
> |     The multi-parameter class `C' cannot have generic methods
> |     In the class declaration for `C'
> | Failed, modules loaded: none.
> | -----
> | 
> | Is there a reason for this restriction, or is it merely an accident?
> | 
> | Cheers,
> | Reiner
> | _______________________________________________
> | Glasgow-haskell-users mailing list
> | Glasgow-haskell-users at haskell.org
> | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> 
> 




More information about the Glasgow-haskell-users mailing list