summaryrefslogtreecommitdiff
blob: c45a2945fd2adfda7c1aaa22a65dd3b6bc056095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/src/ParseLib2.hs b/src/ParseLib2.hs
index 730e4be..a7406fa 100644
--- a/src/ParseLib2.hs
+++ b/src/ParseLib2.hs
@@ -34,2 +34,3 @@ module ParseLib2
 import Data.Char
+import Control.Applicative hiding ( many )
 import Control.Monad
@@ -49,2 +50,6 @@ instance Functor Parser where
 
+instance Applicative Parser where
+    pure  = return
+    (<*>) = ap  -- defined in Control.Monad
+
 instance Monad Parser where
@@ -58,2 +63,6 @@ instance Monad Parser where
 
+instance Alternative Parser where
+    (<|>) = mplus
+    empty = mzero
+
 instance MonadPlus Parser where