CompSciCabal / SMRTYPRTY

We read computer science books for fun. This is where the secret notes live.
The Unlicense
77 stars 11 forks source link

Why Dependent Types Matter #74

Closed xtreme-james-cooper closed 6 years ago

xtreme-james-cooper commented 7 years ago

By Thorsten Altenkirch, Conor McBride, and James McKinna http://www.cs.nott.ac.uk/~psztxa/publ/ydtm.pdf

Types matter. That’s what they’re for—to classify data with respect to criteria which matter: how they should be stored in memory, whether they can be safely passed as inputs to a given operation, even who is allowed to see them. Dependent types are types expressed in terms of data, explicitly relating their inhabitants to that data. As such, they enable you to express more of what matters about data. While conventional type systems allow us to validate our programs with respect to a fixed set of criteria, dependent types are much more flexible, they realize a continuum of precision from the basic assertions we are used to expect from types up to a complete specification of the program’s behaviour. It is the programmer’s choice to what degree he wants to exploit the expressiveness of such a powerful type discipline. While the price for formally certified software may be high, it is good to know that we can pay it in installments and that we are free to decide how far we want to go. Dependent types reduce certification to type checking, hence they provide a means to convince others that the assertions we make about our programs are correct.