Browse thread
[Caml-list] Odd Type Checking Problem
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Markus Mottl <markus@o...> |
| Subject: | Re: [Caml-list] Type variables (was: Odd Type Checking Problem) |
On Fri, 08 Feb 2002, Jacques Garrigue wrote: > > Are there any plans to lift this restriction? This would e.g. allow using > > polymorphic types in functor arguments that expect monomorphic instances, > > because the free variable could be bound in an outer scope. For instance, > > one could create "polymorphic" sets of elements with the already existing > > Set-implementation. > > Interesting point. It looks like it could work locally. Notice however > that you wouldn't be able to to return such a set from the scope of > the let module. So basically you've not not earned a lot: just the > capacity to hide the fact you're calling a functor inside your > function. Currently you would have to make your function into a functor. True, but one can return closures that operate on the set. When they are recursive, this would allow just about anything. So the functor only has to be applied once. Hm, with some syntactic sugaring, this might give us something similar to first-class modules, wouldn't it? Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr