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
22 weeks 3 days ago
22 weeks 3 days ago
22 weeks 3 days ago
44 weeks 4 days ago
48 weeks 6 days ago
50 weeks 3 days ago
50 weeks 3 days ago
1 year 1 week ago
1 year 5 weeks ago
1 year 5 weeks ago