diff options
author | Austin Seipp <austin@well-typed.com> | 2013-09-11 18:46:54 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2013-09-11 18:47:15 -0500 |
commit | b20cf4ecbf244f091f4084c11ae2350d248ce6ef (patch) | |
tree | d595c6c632773bb4110468c23467f0b339096538 /compiler/utils/IOEnv.hs | |
parent | 1ef941a82eafb8f22c19e2643685679d2454c24a (diff) | |
download | haskell-b20cf4ecbf244f091f4084c11ae2350d248ce6ef.tar.gz |
Fix AMP warnings.
Authored-by: David Luposchainsky <dluposchainsky@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/utils/IOEnv.hs')
-rw-r--r-- | compiler/utils/IOEnv.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 583e875903..04c11cf531 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -42,6 +42,7 @@ import System.IO.Unsafe ( unsafeInterleaveIO ) import System.IO ( fixIO ) import Control.Monad import MonadUtils +import Control.Applicative (Alternative(..)) ---------------------------------------------------------------------- -- Defining the monad type @@ -150,9 +151,13 @@ unsafeInterleaveM (IOEnv m) = IOEnv (\ env -> unsafeInterleaveIO (m env)) ---------------------------------------------------------------------- --- MonadPlus +-- Alternative/MonadPlus ---------------------------------------------------------------------- +instance MonadPlus IO => Alternative (IOEnv env) where + empty = mzero + (<|>) = mplus + -- For use if the user has imported Control.Monad.Error from MTL -- Requires UndecidableInstances instance MonadPlus IO => MonadPlus (IOEnv env) where |