"class []" proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

Brian Hulley brianh at metamilk.com
Tue Aug 22 10:37:48 EDT 2006

Bulat Ziganshin wrote:
>>> f :: Num a => a -> Int
>>> write as
>>> f :: Num -> Int
> so, while this proposal is rather minor, i think that it is Good thing

I wouldn't like it because I'd like to eventually make the class namespace 
separate from the tycon namespace so that I could write:

    class Object a where

    data Object = forall a. Object a => Object a

etc (this goes with H' proposal that the namespace should always be explicit 
on the module export/import list [1]).

A good editor (hint: the one I'm writing!!!) will be able to highlight the 
uses of "Object" to make it clear which is a class, which is a Tycon, and 
which is a ValueCon, and the operation of replacing a concrete type with a 
class in the type signature to generalise some functions could be made 
easier with a good refactoring tool.

Best regards,

Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.


More information about the Haskell-Cafe mailing list