[Haskell-cafe] namespaces for values, types, and classes

Sebastian Fischer sebf at informatik.uni-kiel.de
Sat Nov 28 20:46:28 EST 2009

>> Does anyone know why types and values are in separate namespaces but
>> classes and types are not?
> I think it's because you cannot currently distinguish them in module
> import/exports.

Ah, good point. For constructors there is special syntax which allows  
to distinguish them in im/exports. Even if you have

     data One = Uno
     data Two = One | Two

and you want to im/export only the constructor `One` but neither the  
type `One` nor the constructor `Two` you can write `Two(One)` to refer  
to it.

So, my assumption that class names and type names always appear in  
different contexts was wrong when it comes to im/exports and there  
doesn't seem to be an easy way to fix that.

Thank you for clarifying!


Underestimating the novelty of the future is a time-honored tradition.

More information about the Haskell-Cafe mailing list