on master help sign in
Merge pull request #1200 from melted/tc
45e0a6bDavid Christiansen
src/Idris/Core/TC.hs+9
@@ -2,6 +2,7 @@
2
2
3module Idris.Core.TC(TC'(..)) where
3module Idris.Core.TC(TC'(..)) where
4
4
5+import Control.Applicative
5import Control.Monad
6import Control.Monad
6import Control.Monad.Trans.Error(Error(..))
7import Control.Monad.Trans.Error(Error(..))
7
8
@@ -26,3 +27,11 @@ instance Error e => MonadPlus (TC' e) where
26 _ `mplus` (OK y) = OK y
27 _ `mplus` (OK y) = OK y
27 err `mplus` _ = err
28 err `mplus` _ = err
28
29
30+
31+instance Error e => Applicative (TC' e) where
32+ pure = return
33+ (<*>) = ap
34+
35+instance Error e => Alternative (TC' e) where
36+ empty = mzero
37+ (<|>) = mplus