diff options
Diffstat (limited to 'src/compiler/GF/Grammar')
| -rw-r--r-- | src/compiler/GF/Grammar/Lexer.x | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/GF/Grammar/Lexer.x b/src/compiler/GF/Grammar/Lexer.x index 681ae9024..c2cbb4c47 100644 --- a/src/compiler/GF/Grammar/Lexer.x +++ b/src/compiler/GF/Grammar/Lexer.x @@ -6,6 +6,8 @@ module GF.Grammar.Lexer , isReservedWord ) where +import Control.Applicative +import Control.Monad(ap) import GF.Infra.Ident --import GF.Data.Operations import qualified Data.ByteString.Char8 as BS @@ -258,6 +260,13 @@ data ParseResult a newtype P a = P { unP :: AlexInput -> ParseResult a } +instance Functor P where + fmap = (<$>) + +instance Applicative P where + pure = return + (<*>) = ap + instance Monad P where return a = a `seq` (P $ \s -> POk a) (P m) >>= k = P $ \ s -> case m s of |
