In this lecture, we cast off the heinous shackles of type annotations after learning about polymorphism. We learned that SML employs a sysmem of parametric polymorphism to assign generic types to expressions, wherever possible.
We learned that due to SML's sophisticated system of type inference, expressions are typed in a more generic way at first, before accumulating type constraints which eventually let types be solved at a more specific final answer.
This system is what ultimately allowed us to have types like lists and options, as our constructors for those types are ultimately polymorphically typed, allowing them to be used at more specific types at different use sites. We saw how we could use our datatype declarations to define our own polymorphically parameterized datatypes.
Finally, we saw how this not just let us have versatile constructors, but versatile functions which are themselves parameterized by functions with generic type. This ties into a concept we will soon learn about called higher-order functions, but we found that this could allow us a great deal of flexibility and reusability in our code.