Type operators in GHC

Matthew Farkas-Dyck strake888 at gmail.com
Thu Jan 19 23:29:17 CET 2012


On 19/01/2012, Ian Lynagh <igloo at earth.li> wrote:
> Do you mean that in
>
>     f :: (x, X, (+), (:+))
>
> only x would be a type variable and X, (+), (:+) would be type
> constructors, but that in
>
>     g :: forall y, Y, (*), (:*) .
>          (x, X, (+), (:+), y, Y, (*), (:*))
>
> y, Y, (*), (:*) would be type variables and x, X, (+), (:+) would be
> whatever is in scope (constructors, unless there is an enclosing forall
> that binds them)?

Just so.

> Perhaps we should be heading towards a case-insensitive syntax for type
> names.

I've often had that thought myself, for types and terms both. It would
make it much nicer to do general numeric computations in Haskell (e.g.
fluid mechanics) since one could use upper-case term names, which are
often customary. I actually designed a compiled-to-Haskell language
for just this reason (for fluid mechanics lab), but it's very crude.

That said, for word-names, the case-sensitive system we have is nice and brief.

>
> Thanks
> Ian
>



More information about the Glasgow-haskell-users mailing list