Naming types
Simon Marlow
marlowsd at gmail.com
Wed Sep 24 10:21:33 EDT 2008
Simon Peyton-Jones wrote:
> As we push the boundary on Haskell’s type system, so that types and
> values blur a bit more, Haskell’s deliberate overlapping of type
> constructor and data constructor name space is becoming a little
> awkward. Syntax is tiresome, but it’s unavoidable.
>
> I’ve written down the issues and made some proposals here.
> http://hackage.haskell.org/trac/ghc/wiki/Design/TypeNaming
>
> Before I broadcast it more widely, I wondered if you had any suggestions
> or thoughts
I support the export list proposal - we'd also discussed something
similar in the context of Haskell'. Allowing you to say 'class C' in an
export list is all that is required to separate the namespace of classes
and type constructors, making it possible to use the same name for both
a class and a tycon.
I'm really not sure about the rest of the proposal. It seems like what
we really need is a way to define kinds, but presumably the idea here
was to try to re-use existing concepts as much as possible.
Let me see if I understand the problem with tuple and list types. So
the normal pair type constructor has kind * -> * -> *, but I think the
suggestion is to also have a pair kind constructor, and a different pair
type constructor of kind * -> * -> (*,*). There are two different pair
type constructors, so they have to be disambiguated. The shift operator
looks rather ugly, and in this case it's not clear why one of the pairs
should be shifted and the other not - they're both type constructors. I
think maybe they should have different syntax, i.e. use different
brackets for the new kind of type pairs, or just don't use brackets at
all and have a Pair kind.
Cheers,
Simon
>
>
>
> Simon
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Cvs-ghc mailing list
> Cvs-ghc at haskell.org
> http://www.haskell.org/mailman/listinfo/cvs-ghc
More information about the Cvs-ghc
mailing list