on master help sign in
Merge pull request #1504 from Heather/eithererr
134dbf8David Christiansen
src/Idris/AbsSyntax.hs+6−1
@@ -17,6 +17,7 @@ import Util.DynamicLinker
17import System.Console.Haskeline
17import System.Console.Haskeline
18import System.IO
18import System.IO
19
19
20+import Control.Applicative
20import Control.Monad.State
21import Control.Monad.State
21import Control.Monad.Error(throwError)
22import Control.Monad.Error(throwError)
22
23
@@ -1663,7 +1664,11 @@ findStatics ist tm = trace (show tm) $
1663 pos ns ss t = return t
1664 pos ns ss t = return t
1664
1665
1665-- for 6.12/7 compatibility
1666-- for 6.12/7 compatibility
1666−data EitherErr a b = LeftErr a | RightOK b
1667+data EitherErr a b = LeftErr a | RightOK b deriving ( Functor )
1668+
1669+instance Applicative (EitherErr a) where
1670+ pure = return
1671+ (<*>) = ap
1667
1672
1668instance Monad (EitherErr a) where
1673instance Monad (EitherErr a) where
1669 return = RightOK
1674 return = RightOK