haskeline
haskeline copied to clipboard
Add `mapInputT_`
This PR adds a variation of mapInputT
that only works on the unit type.
mapInputT_ :: (m () -> m ()) -> InputT m () -> InputT m ()
mapInputT_ f = InputT . mapReaderT (mapReaderT (mapReaderT
(mapReaderT (mapReaderT f))))
. unInputT
Note that mapInputT_
cannot be implemented in terms of mapInputT
because of the forall b
quantifier inside the first argument of mapInputT
. Thus, it makes sense to also export mapInputT_
, since there are cases in which it can be useful.