skaller wrote:
> This is a standard problem with any modular construction IMHO.
>
Agreed. The only thing I can say (quickly) is to take a look at what
has been done in some of the more advanced specification languages based
on category theory. Their module systems are reasonably sane.
> The standard solution is structural typing, that is,
> setwise combination of elements.
>
But then + and * have the same type, which can be problematic!
> Instances have to be definitive because typing is nominal.
>
> There is also a hidden reason why this *ought* to be the
> case, wrapped up in the idea of nominal types: semantics.
>
> typeclass A .. typeclass B ..
>
> typeclass AB1 { inherit A; inherit B; axiom a1; }
> typeclass AB2 { ... axiom a2; }
>
> Same sets of functions here .. but the type classes are
> quite distinct because they have distinct axioms.
>
> We do not want AB1 and AB2 to be automatically instantiated
> from A and B because whilst AB1 might obey the axioms,
> AB2 may not.
>
Right - but AB1 and AB2 are different, because they have different
axioms. And until it is known that they are satisfied, instantiation
can't happen. So I guess I don't quite understand the problem (ie I
don't see a problem).
> I'm concerned the typeclass alias proposal is just too weak:
> if you're going to introduce typeclass combinators the ones
> to consider should probably be:
>
> + | * | ->
>
> as usual .. :)
>
Agreed. However you are missing a very important combinator: renaming.
As long as there are names that matter, they'll get in the way, and
you'll wish there was a way to rename some of the names for a particular
use. That's why I pointed to the Ramsey et al paper.
> This is also a problem with ML modules IMHO.
>
Yep.
Jacques
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language