User loginNavigation |
archivesTurning 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. |
Browse archivesActive forum topics |
Recent comments
36 weeks 9 hours ago
36 weeks 12 hours ago
36 weeks 12 hours ago
1 year 6 weeks ago
1 year 10 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 14 weeks ago
1 year 19 weeks ago
1 year 19 weeks ago