Commit c0e985e5 authored by judah's avatar judah Committed by GitHub
Browse files

Merge pull request #42 from avieth/aovieth/monad_fix

MonadFix instance for InputT
parents f18a911b 13d2bd1d
......@@ -15,6 +15,7 @@ import System.Directory(getHomeDirectory)
import System.FilePath
import Control.Applicative
import Control.Monad (liftM, ap)
import Control.Monad.Fix
import System.IO
import Data.IORef
......@@ -56,6 +57,9 @@ newtype InputT m a = InputT {unInputT ::
instance MonadTrans InputT where
lift = InputT . lift . lift . lift . lift . lift
instance ( MonadFix m ) => MonadFix (InputT m) where
mfix f = InputT (mfix (unInputT . f))
-- | Get the current line input history.
getHistory :: MonadIO m => InputT m History
getHistory = InputT get
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment