Synonym Type Constructors

Fergus Henderson fjh@cs.mu.oz.au
Tue, 20 Feb 2001 01:34:52 +1100


On 19-Feb-2001, Ashley Yakeley <ashley@semantic.org> wrote:
> I don't know if this is a bug in Hugs 98, or whether it's a 
> misunderstanding of mine.
> 
> The Haskell 98 Report Sec. 4.2.2 claims that 'type' introduces a new type 
> constructor.

Right.  So by definition, it does.

> Yet it doesn't seem possible to declare the type constructor 
> an instance of a class:
...
> Hugs gives:
> (line 6): Not enough arguments for type synonym "T"

That is also correct.

As the Haskell Report section 4.2.2 says:

 | Type constructor symbols T introduced by type synonym declarations
 | cannot be partially applied; it is a static error to use T without the
 | full number of arguments.

> So is T a real type constructor or not?

The Haskell 98 Report does not define the term "real type constructor".
So this is one of those existential philosphical debates about terminology ;-)
Personally I would describe the type constructors introduced by type
synonym declarations as "real", but not "first class".

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.