In this lecture, we learned about more of the basics of SML. We explored some of the basic types and values given as primitives of the language, and how we can compose types into other types using type constructors to make tuple types and function types.
We saw how we can make other values, like anonymous lambda expressions and tuples. We learned about binding, a concept different than assignment, where variables are associated to values. Importantly, this is done in a way that preserves function purity by ensuring that functions are not affected by bindings that happen after their own declaration.
We also introduced patterns, which are constructs in SML that allow us to match on values to do things like extract fields from a tuple. We also saw that functions can be written in a way that uses patterns to determine what behavior to execute, as opposed to conditionals.
Finally, we wrapped up by introducing the concept of extensional equivalence, a relation on SML expressions of the same type which share the same behavior. We saw that extensionally equivalent expressions obey referential transparency, meaning that they are exchangeable wherever they appear, and support mathematically-assured refactoring of code.