User loginNavigation |
Turning every module into a functor automatically?IIRC, I've read about this approach in one of the ReadScheme module papers: Say we have an ML-like higher-order module system, but every time a module M uses another module U, M automatically becomes a functor, that by default uses U, but could also be parameterized post-hoc to use another module V in place of U: structure M = let f x = U.do_something x structure U = let do_something x = ...
By default, M would use U's implementation of But a client could also supply another implementation (structure), as long as it has the same signature as U: structure V = let do_something x = ... structure M' = M parameterize U = V
The I think this would be quite convenient in some cases (e.g. supplying a different string implementation for a module – "monkey patching"). Comments? Update: Martin Gasbichler's Fully-parameterized, first-class modules with hygienic macros calls this feature full parameterization. By Manuel J. Simoni at 2009-09-19 15:47 | LtU Forum | previous forum topic | next forum topic | other blogs | 6574 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 1 day ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago