Function composition hint

Viewed 365

just looking for an explanation how does following composition work:

(=<<) . return

where

(=<<) ::       (a -> m b) -> m a -> m b
return :: a -> m a
(.) :: (b -> c) -> (a -> b) -> a -> c

The final type:

GHCi> :t (=<<) . return
(=<<) . return :: Monad m => m b -> m a -> m b

I cann't grasp how can match m a with (a -> m b) , ie. how can apply result of return which is a simple type to first argument of (=<<) expecting a function type ?

2 Answers
Related