Closed remexre closed 7 years ago
I think it's not possible as the monad is defined now. The type of InputT
is essentially InputT m a = InputT (r -> CompletionFunc m -> m a
):
https://github.com/judah/haskeline/blob/master/System/Console/Haskeline/Completion.hs
where CompletionFunc m
is defined here:
https://github.com/judah/haskeline/blob/master/System/Console/Haskeline/Completion.hs
A much simpler example is:
newtype InputT m a = InputT (m () -> m a)
for which you can't write a mapInputT
with the type you suggested.
Do you have a specific use case for such a mapInputT
? If so, maybe we can find a different combinator that would solve the same problem.
I was trying to do InputT MyNewtype () -> InputT IO (State, Either Err a)
, but I actually rewrote to avoid that; still, it seems like something that ought to exist... If it's not possible though, you can close this; I just wanted to be sure.
Right now,
mapInputT
has the type:As I understand it (I'm new to transformers, so correct me if I'm wrong), the type should be:
in order to allow for changing the base monad.