Coming Up‎ > ‎

January meetup: 14.01.2014

posted 7 Jan 2014, 07:09 by Ed Lambda   [ updated 7 Jan 2014, 07:09 ]
Bob Atkey has stepped forward with a late Christmas gift.

When: Tuesday 14th January, 7pm @ Outhouse pub
Title: 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

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.