The Total Recall combinator
1/04/2009infixr 9 .: (.:) :: (b -> c) -> (a -> a1 -> b) -> a -> a1 -> c (.:) = (.)(.)(.)
This can be used to compose a string of functions with a binary function stuck on the end. For example:
lookupPlusOne :: (Ord k, Monad m, Num n) => k -> Map k n -> m n lookupPlusOne = liftM (+1) .: lookup
(picked up from some folks on #haskell)
There are 2 comments in this article: