[clean-list] About abstract synonym types...
Fergus Henderson
fjh@cs.mu.oz.au
Thu, 5 Feb 2004 15:37:22 +1100
On 04-Feb-2004, Fabien TODESCATO <fabien.todescato@wanadoo.fr> wrote:
> The Clean home pages advertises the new 2.1 version as featuring
> "abstract synonym types". I couldn't however find any explanations nor
> any syntax definition in the relese 2.1 of the language report that
> ships with the system.
I'm guessing that an "abstract synonym type" would be an abstract type
that is defined as a synonym type. An abstract type is one whose
name is exported to other modules.
> Is this "abstract synonym types facility" the equivalent of the
> "newtype" construction in Haskell ?
If my guess is right, then no, the two are not really equivalent.
The difference is that with Haskell's newtype, conversions between the
abstract type and its definition must be explicit.
> And if so, are recursive type definitions supported ?
I think the answer to that is probably no, because IIRC Clean does
not support recursive synonym types.
I have my own questions about abstract synonym types in Clean 2.1:
- how do they interact with type classes?
- how do they interact with separate compilation?
Does changing the definition of an abstact synonym type
require recompiling modules that import the module which
defines it?
- has the Clean team considered how abstract synonym types
should be supported if compiling to a strongly-typed target
language that does not support abstract synonym types,
such as C++, Java, the JVM, or the .NET CLR?
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.