summaryrefslogtreecommitdiff
blob: 9578c926528e6c711c9136f0a4b6f8b61d00e5b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- options-1.2.1-orig/lib/Options/Tokenize.hs	2014-12-14 16:34:53.000000000 +1100
+++ options-1.2.1/lib/Options/Tokenize.hs	2015-01-02 00:14:05.390013340 +1100
@@ -11,6 +11,7 @@
 	, tokenize
 	) where
 
+import           Control.Applicative
 import           Control.Monad.Error hiding (throwError)
 import qualified Control.Monad.Error
 import           Control.Monad.State
@@ -53,6 +54,13 @@
 
 newtype Tok a = Tok { unTok :: ErrorT String (StateT TokState Identity) a }
 
+instance Functor Tok where
+    fmap  = liftM
+
+instance Applicative Tok where
+    pure  = return
+    (<*>) = ap
+
 instance Monad Tok where
 	return = Tok . return
 	m >>= f = Tok (unTok m >>= unTok . f)