archives

New category for Ruby posts

After some hesitation I decided to add a Ruby department to the spotlight category. This is where (home page) posts relating to Ruby should now be filed.

This doesn't imply we now have a special preference for Ruby. It simply reflects that more and more items related to Ruby are posted, and I want them easily found. The other language in the spotlight category is Python, which is there for a long time since there were many interesting experiments with Python, which we discussed many times in the past.

Collection of links to monad implementations in various languages.

Due to recent discussions here on LtU and on the Haskell mailing lists I've compiled a list of links to implementations of monads in various languages. If you know of any that aren't listed here, please submit them in a comment.

A longer article with side by side comparisons of the implementations would be interesting, and may help students understand monads by separating them from any one syntax or implementation.

Monads are an idiom, but Idiom isn't a monad

Functional Pearl: Applicative programming with effects, Conor McBride and Ross Patterson

In this paper, we introduce Applicative functors—an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this paper, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation which interprets the normal application syntax in the idiom of an Applicative functor. Further, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrows.

A well written introduciton to a monad cousin, with a tantilizing hint that idioms are easier to introduce into Haskell syntax:

Given Haskell extended with multi-parameter type classes, enthusiasts for overloading may replace [[ and ]] by identifiers iI and Ii with the right behaviour3.

3 Hint: Define an overloaded function applicative u v1 . . . vn Ii = u (*) v1 ... (*) vn