Haskell style type classes in Javascript.