As mentioned in the comments of @ 4castle, the feature you are looking for is join
in Control.Monad
. This type
join :: Monad m => m (m a) -> m a
The reader’s simple monad (->) r
, so if we install m ~ (->) r
, we get
join :: (->) r ((->) r a) -> (->) r a
or, more briefly,
join :: (r -> r -> a) -> (r -> a)
What would you like.
source
share