Visualizing a Scala Functor

I was reading about functors in scala and decided to draw a picture of an example functor

The outermost rectangles are categories, with the inner rectangles represent objects, in this example Scala types. The inner arrows are morphisms between objects, while the outer arrows represent the functors themselves, with List as the type constructor. Functors map categories, made up of objects and morphisms, so here we have

  • The object Int is mapped to the object List[Int]
  • The morphism Int.toString() is mapped to the morphism List[Int].map(Int.toString())

Note that morphisms map objects in the sense of their constituents, whereas functors map the objects themselves (as they are one of the constituents of the category).

Scala, Functional Programming and Play 2.0

Here’s a short but interesting interview with Sadek Drobi who’s behind the Play framework. Drobi discusses

  • What is functional programming, why it is becoming more popular and how it relates to Object Orientation (OO)
  • How Scala approaches functional programming from an OO base
  • Scala’s complexity as a language and how to manage it through guidelines
  • Play as a rails-type framework for the jvm with special emphasis on asynchronous processing for scalability
  • How abstracting over javascript is a mistake for web frameworks, as complexity mounts in the long run