Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GeeCon: Typeclasses, Monads - functional and simple!

GeeCon: Typeclasses, Monads - functional and simple!

I am quite excited how elegantly we can solve IO-bound problems like DB access with this new set of tools Scala and functional programming provides. I've recently built a simple Cassandra client using actors, type classes and monads while migrating one of our systems at Zeebox from Amazon S3 to Cassandra. It is simple and elegant (I believe :)) and it shows the real power of the language. So no more Java-like code written in Scala - It is functional but simple and powerful. Until recently, I was scared myself whenever I've heard the phrase "type class" let alone monad or theory of categories. I realised that all it is, is just that mathematicians tend to overcomplicate things hiding it behind theorems and proofs. Real life examples of monoids, monads or type classes can be quite simple and understandable for everybody.

Video will be available here:
http://2013.geecon.org/speakers/piotr-gabryanczyk

Piotr Gabryanczyk

May 24, 2013
Tweet

More Decks by Piotr Gabryanczyk

Other Decks in Technology

Transcript

  1. What is type class? Type class == Group of types

    T belongs to CassandraObject typeclass if there is class X such that X extends CassandraObject[T]