Parsec
Parsec.Expr を使用 module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser, reservedOpNames ) import qualified Text.ParserCom…
コマンドラインからの入力 module Main where import System import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser ) import qualified Text.ParserCombinators.Parsec.Token as P import Text.…
小数で module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser ) import qualified Text.ParserCombinators.Parsec.Token as P import Text.ParserCombinators.Parsec.Languag…
整数のみ module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser ) import qualified Text.ParserCombinators.Parsec.Token as P import Text.ParserCombinators.Parsec.Langu…
Prelude> :m Text.ParserCombinators.Parsec.Perm Prelude Text.ParserCombinators.Parsec.Perm> :t (<$?>) (<$?>) :: (a -> b) -> (a, Text.ParserCombinators.Parsec.Prim.GenParser tok st a) -> PermParser tok st b Prelude Text.ParserCombinators.Par…
Prelude> :t Text.ParserCombinators.Parsec.Perm.(<$$>) <interactive>:1:0: Not in scope: data constructor `Text.ParserCombinators.Parsec.Perm' <interactive>:1:35: Not in scope: `<$$>' Prelude> :m Text.ParserCombinators.Parsec.Perm Prelude Text.ParserCombinators.Parse</interactive></interactive>…
Prelude> :t Text.ParserCombinators.Parsec.Perm.permute Text.ParserCombinators.Parsec.Perm.permute :: Text.ParserCombinators.Parsec.Perm.PermParser tok st a -> Text.ParserCombinators.Parsec.Prim.GenParser tok st a まんま module Main where i…
Prelude> :m Text.ParserCombinators.Parsec.Perm Prelude Text.ParserCombinators.Parsec.Perm> :i PermParser data PermParser tok st a = Text.ParserCombinators.Parsec.Perm.Perm (Maybe a) [Text.ParserCombinators.Parsec.Perm.Branch tok st a] -- D…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t mergeError mergeError :: ParseError -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error> mergeError (newErrorUnknown (Text.…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t setErrorMessage setErrorMessage :: Message -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error> setErrorMessage (SysUnExpec…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t setErrorPos setErrorPos :: Text.ParserCombinators.Parsec.Pos.SourcePos -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error>…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t addErrorMessage addErrorMessage :: Message -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error> addErrorMessage (SysUnExpec…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t newErrorUnknown newErrorUnknown :: Text.ParserCombinators.Parsec.Pos.SourcePos -> ParseError Prelude Text.ParserCombinators.Parsec.Error> (newE…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t newErrorMessage newErrorMessage :: Message -> Text.ParserCombinators.Parsec.Pos.SourcePos -> ParseError Prelude Text.ParserCombinators.Parsec.E…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorIsUnknown <interactive>:1:0: Not in scope: `errorIsUnknown' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombin</interactive>…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t showErrorMessages showErrorMessages :: String -> String -> String -> String -> String -> [Message] -> String Prelude Text.ParserCombinators.Par…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t messageEq messageEq :: Message -> Message -> Bool Prelude Text.ParserCombinators.Parsec.Error> messageEq (SysUnExpect "foo") (SysUnExpect "foo"…
Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t messageCompare messageCompare :: Message -> Message -> Ordering Prelude Text.ParserCombinators.Parsec.Error> :t (SysUnExpect "foo") (SysUnExpec…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t Message <interactive>:1:0: Not in scope: data constructor `Message' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCom</interactive>…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorMessages <interactive>:1:0: Not in scope: `errorMessages' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinat</interactive>…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorPos errorPos :: ParseError -> SourcePos module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :i ParseError data ParseError = Text.ParserCombinators.Parsec.Error.ParseError !SourcePos [Text.ParserCombinators.Parsec.Error.Message] -- Defined in Text.Par…
module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.ParserCombinators.Parsec.Language lexer :: TokenParser () lexer = makeTokenParser(javaStyle) test = do { setInput "foo" ; string …
module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.ParserCombinators.Parsec.Language lexer :: TokenParser () lexer = makeTokenParser(javaStyle) test = do { string "foo" ; x <- getI…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t setPosition setPosition :: SourcePos -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Tok…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t getPosition getPosition :: GenParser tok st SourcePos module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token imp…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t updateState updateState :: (st -> st) -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.To…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t setState setState :: st -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Tex…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t getState getState :: forall st tok. GenParser tok st st Prelude Text.ParserCombinators.Parsec> getSate <interactive>:1: Variable not in scope: `getSate' module Main whe</interactive>…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t unexpected unexpected :: forall a st tok. String -> GenParser tok st a Prelude Text.ParserCombinators.Parsec> parseTest (unexpected "MESSAGE") "abc" Loadin…