The real world is messy – in fact, it's hazardous. We build hulking fortresses around our code to protect our apps from the real world. However, the tools we use – the languages and third-party libs – often conceal lurking hazards, too. Loosely typed APIs allow developers to make common mistakes that will blow up at run-time. Stateful APIs can be even more insidious.



Can we preclude hazards of loose typing and mutable state at compile time?



Yes. We'll look at a popular third-party tool, Memcached, and criticize some hazardous parts of its API. Then we'll show you how we fixed them using the safety of strong types via Haskell.