Skip to main content

GSA: Scala: How to sneak Haskell design patterns into industry code

Will Sonnex

Haskell is an awesome language, even if a lot of development time is spent marvelling at the beautiful abstractions you have created, and at your own genius for creating them. Unfortunately "the man" will tell you such code is hard to understand, hard to debug, and has performance which is difficult to reason about. Thankfully, someone created a language which allows you to express many of these beautiful abstractions, which still looks enough like Java that people will let you use it in industry code, Scala!

In this talk I will outline some of the design patterns we have managed to abuse our code-base with, including type-classes, monad for comprehensions, implicit classes (these are like extension methods in C#, but way more powerful), and property based testing. One of my sexy examples will be the three-valued logic system we use in order to properly answer the question, "is NaN equal to NaN?".

 

 

Share this: