haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
223 stars 75 forks source link

Generalise constraints for InputT instances #31

Closed hvr closed 8 years ago

hvr commented 8 years ago

I'm not sure why the code was written the way it was, but it seems we can do better by letting GHC directly reuse ReaderT's instances as well as relaxing the constraints from

instance Monad m       => Functor     (InputT m)
instance Monad m       => Applicative (InputT m)
instance Monad m       => Monad       (InputT m)

to

instance Functor     m => Functor     (InputT m)
instance Applicative m => Applicative (InputT m)
instance Monad       m => Monad       (InputT m)

This looks the same on GHC 7.8 (pre-AMP) as well as on GHC 7.10 (post-AMP)

hvr commented 8 years ago

fwiw, the Travis build failed due to network I/O timeout