3 ms·
There are a few advantages of modules. One is that they can encapsulate types along-side functions/values. Also, it can be advantageous that functors are applie
by wtetzner 8y ago
There are a few advantages of modules. One is that they can encapsulate types along-side functions/values. Also, it can be advantageous that functors are applied at compile time.
The really cool one though is abstract types. You can distinguish types purely in the type system, with no change to run-time representation, using module signatures that don't specify the concrete type of a type entry.