suztomoの日記

To be a good software engineer

Left-to-right Kleisli composition

Control.Monad

(>=>)       :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)
f >=> g     = \x -> f x >>= g

Once we define ">>=" operator, we can use this left-to-right Kleisli composition using the default implementation.