EdLambda: Bob Atkey: Some practical and impractical uses of ML module systems

Most programming languages provide facilities for splitting programs up into modules. Modules break large programs down into smaller, more understandable components.

While most languages have support for dividing up programs into modules, not many have explicit support for composing modular programs. Modules end up with hard-coded references to other modules, making programs harder to test and less flexible. To mitigate this problem, techniques like dependency injection frameworks or monkey patching are often used to compose programs from modular pieces at runtime.

Most languages in the ML family take a different approach. Languages like OCaml and SML include a extra functional language on top of the core language, designed specifically for composing modules. Using this module language the programmer can write modules that are parameterized by modules, allowing modules to be written without necessarily hard coding references to the concrete implementations.

In this talk I'll show off some examples of using the module systems in OCaml and SML. I'll demonstrate examples show practical uses to make code more modular and testable, examples that use modules to encode properties not expressible in the core language, and some impractical examples for fun. I'll also discuss some of the problems with the module system when you start to use them seriously.

to (Europe/London time)

More details: sites.google.com

More Information

About EdLambda

EdLambda is an Edinburgh group for people interested in functional programming which has been running since September 2010. We meet in the Outhouse pub on the 2nd Tuesday of every month at 7pm. There is usually a talk on a subject of interest to functional programmers, followed by chat and drink! EdLambda meetups are free events and everyone is welcome.

12A Broughton St Ln, Edinburgh, Midlothian EH1 3LY