[Haskell-cafe] Extending the idea of a general Num to other types?

Jules Bean jules at jellybean.co.uk
Wed Sep 5 07:22:18 EDT 2007


Ketil Malde wrote:
>>
>>         String is not an instance of class Foo  -- single param
>>         No instance for (Bar String Int)                -- multi-param
> 
> If you quote things, you can also consider:
> 
>  	   'String Int' is not an instance of class 'Bar'.
> 
> Downside is that 'String Int' by itself may be confusingly unhaskellish.

String is not an instance of class Foo
String and Int do not form an instance of multi-parameter class Bar


...alternatively, you can put the more mathsy form in brackets after the 
simple one, to make the generalisation from the single param to the 
multi-param more clear:

String is not an instance of class Foo (No instance for Foo String)
No instance for (Bar String Int)





More information about the Haskell-Cafe mailing list