Skip to content

Conversation

janmasrovira
Copy link

@janmasrovira janmasrovira commented May 25, 2023

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.

@janmasrovira janmasrovira marked this pull request as ready for review May 25, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant