Talk by Anthony Sheldon for the Bay Area Haskell Users Group (BAHUG) virtual meetup on May 2, 2020. Meetup link: https://www.meetup.com/Bay-Area-Haskell-Users-Group/events/270204729/
NoRedInk, a San Francisco company that uses Haskell, kindly offered to host this meetup at their office, but due to the COVID-19 pandemic we held this meetup virtually via Zoom. Software Engineer Katie Hughes from NoRedInk joined us to share some details about NoRedInk near the beginning of the video.
0:00 - Introduction (Stephan Boyer)2:06 - About NoRedInk (Katie Hughes)5:35 - Main talk (Anthony Sheldon)Abstract for Anthony's talk:
Library authors are often faced with a design choice: should a function with preconditions be implemented as a partial function, or by returning a failure on incorrect usage? Neither option is ideal. Partial functions lead to frustrating run-time errors. Failure must be checked at the use-site, placing an unfair tax on the users who have ensured that the function’s preconditions were met. What if you could achieve many of the benefits of dependent and refinement types, whilst only requiring some minor and well understood extensions to haskell2010? TL;DR: You can use the same rank-2 types trick used in the ST monad to get the compiler to check a surprisingly wide range of API invariants and preconditions.
Slides: https://slides.com/anthony-1/deck-1c0c6a
Also available on YouTube: https://youtu.be/AaQtAAC29Es