Merge pull request #1200 from melted/tc
Future-proof the TC' monad
commit45e0a6bed01934674e1787b636ff97c2e285ce13
authorDavid Christiansen <david@davidchristiansen.dk>
dateTue 6 May 2014, 20:07 (12 years ago)
parent29cd87030ee9ad
src/Idris/Core/TC.hs+9
@@ -2,6 +2,7 @@
22
33module Idris.Core.TC(TC'(..)) where
44
5+import Control.Applicative
56import Control.Monad
67import Control.Monad.Trans.Error(Error(..))
78
@@ -26,3 +27,11 @@ instance Error e => MonadPlus (TC' e) where
2627 _ `mplus` (OK y) = OK y
2728 err `mplus` _ = err
2829
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