== Summary == - We continued with the number library example from last lecture - We discussed the use of functors to define new modules that are parameterized on existing modules. - We introduced functors, which allow us to define modules that depend on other modules. Functors are analogous to functions, but instead of taking values as arguments and returning values, they take modules as arguments and return other modules. - We used functors to implement Vectors and Fractions - We also used functors to implement the "Extension" interfaces for the various number types, giving us generic implementations of <>. >=, <=, (binary) -, /, and so on. - We noticed the "multiplicative effect"; by reusing our functors with a few base modules, we could implement a large family of modules == Provided code == This lecture's source code extends last lecture's source code; the algebra.ml/i files have changed only cosmetically. The new files are impls.ml and impls.mli, which contain the functors we have defined, and all of the modules we derived from those functors. The included comments contain much more detail from the lecture. == Additional references == Chapter 9 of Real World OCaml describes functors in detail. It also walks through an example of the "Core" and "Extension" design pattern we used in our library.