diff options
Diffstat (limited to 'compiler/parser/Lexer.x')
-rw-r--r-- | compiler/parser/Lexer.x | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index cfe795585b..8fd5bd93db 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -88,6 +88,7 @@ import Ctype import BasicTypes ( InlineSpec(..), RuleMatchInfo(..), FractionalLit(..) ) import Util ( readRational ) +import Control.Applicative import Control.Monad import Data.Bits import Data.ByteString (ByteString) @@ -1680,6 +1681,13 @@ data ALRLayout = ALRLayoutLet newtype P a = P { unP :: PState -> ParseResult a } +instance Functor P where + fmap = liftM + +instance Applicative P where + pure = return + (<*>) = ap + instance Monad P where return = returnP (>>=) = thenP |