dropWs : List Char -> List Char
Drop leading whitespace.
import nécessaire.show text (the dual of Show)dropWs : List Char -> List CharallBlank : List Char -> BoolorElse : Maybe (a, List Char) -> Maybe (a, List Char) -> Maybe (a, List Char)isIdentChar : Char -> BoolpName : String -> List Char -> Maybe (List Char)optParen : (List Char -> Maybe (a, List Char)) -> List Char -> Maybe (a, List Char)pChar : Char -> List Char -> Maybe (List Char)parseDigits : List Char -> List Char -> Maybe (Int, List Char)intP : List Char -> Maybe (Int, List Char)fixedP : (Int -> w) -> (w -> Int) -> List Char -> Maybe (w, List Char)doubleP : List Char -> Maybe (Double, List Char)takeSign : List Char -> (List Char, List Char)takeMantissa : List Char -> Maybe (List Char, List Char)takeExp : List Char -> (List Char, List Char)takeExpBody : Char -> List Char -> (List Char, List Char)charP : List Char -> Maybe (Char, List Char)unescape : Char -> Maybe CharstrP : List Char -> Maybe (String, List Char)scanStr : List Char -> Maybe (List Char, List Char)unescStr : Char -> Maybe Charinterface Parse a whereparse : Parse a => String -> Maybe aparseParen : (List Char -> Maybe (a, List Char)) -> List Char -> Maybe (a, List Char)parseName : String -> List Char -> Maybe (List Char)parseOrElse : Maybe (a, List Char) -> Maybe (a, List Char) -> Maybe (a, List Char)parseListElems : (List Char -> Maybe (a, List Char)) -> List Char -> Maybe (List a, List Char)parseListMore : (List Char -> Maybe (a, List Char)) -> List a -> List Char -> Maybe (List a, List Char)dropWs : List Char -> List Char
Drop leading whitespace.
allBlank : List Char -> Bool
Is the rest only whitespace? (parse requires it after the value.)
orElse : Maybe (a, List Char) -> Maybe (a, List Char) -> Maybe (a, List Char)
The first parser that succeeds (used for constructor alternatives).
isIdentChar : Char -> Bool
pName : String -> List Char -> Maybe (List Char)
Expect the exact constructor name at the front (after spaces), as a WHOLE token — the following char, if any, must not continue an identifier, so Red does not match the prefix of RedX. Returns the unconsumed rest.
optParen : (List Char -> Maybe (a, List Char)) -> List Char -> Maybe (a, List Char)
Run p, accepting one optional layer of surrounding parentheses (show adds them around a compound or negative argument).
pChar : Char -> List Char -> Maybe (List Char)
Expect a single literal character (after spaces); return the rest.
parseDigits : List Char -> List Char -> Maybe (Int, List Char)
intP : List Char -> Maybe (Int, List Char)
Parse a signed integer from the front.
fixedP : (Int -> w) -> (w -> Int) -> List Char -> Maybe (w, List Char)
Parse a signed integer prefix, then NARROW it to a fixed-width scalar via the supplied wrap : Int -> w / val : w -> Int. Succeeds only when the value ROUND-TRIPS (val (wrap n) == n) — i.e. it lies in the type's range; an out-of-range literal (256/-1 for Word8, 128 for Int8) fails with Nothing, exactly like tryCast : Int -> Maybe wN. Accepts one optional paren layer (Show's showParen wraps a negative IntN at precedence > 6), mirroring Parse Int. Parametric in w (no dictionary): the caller supplies the target width's own wrap/val pair.
doubleP : List Char -> Maybe (Double, List Char)
Consume a Double LEXEME — [+-]?(digits(.digits?)?|.digits)([eE][+-]?digits)? — from the FRONT, then convert exactly that lexeme with parseDouble (finite, bit-exact across backends). Returns the value with the unconsumed rest, so a Double COMPOSES inside a tuple/list parse — unlike parseDouble, which demands the WHOLE string. A lone . (no digits), or an e not followed by exponent digits, is not part of the number (that e is left for the caller). The lexeme is built to the same grammar the JS backend's parseDouble regex accepts, so the three parseDouble implementations (OCaml/JS/C) never disagree on it.
takeSign : List Char -> (List Char, List Char)
takeMantissa : List Char -> Maybe (List Char, List Char)
takeExp : List Char -> (List Char, List Char)
takeExpBody : Char -> List Char -> (List Char, List Char)
charP : List Char -> Maybe (Char, List Char)
Parse a 'c'-style character literal (with show's escapes).
unescape : Char -> Maybe Char
strP : List Char -> Maybe (String, List Char)
Parse a "…"-style string literal, un-escaping \" \\ \n \t \r (the inverse of Show String's escaping, so parse (show s) == Just s).
scanStr : List Char -> Maybe (List Char, List Char)
unescStr : Char -> Maybe Char
interface Parse a where
parsesPrec : Nat -> List Char -> Maybe (a, List Char)
A type whose values can be parsed back from show-style text.
parse : Parse a => String -> Maybe a
Parse a whole string (no trailing input but whitespace), or Nothing.
parseParen : (List Char -> Maybe (a, List Char)) -> List Char -> Maybe (a, List Char)
parseName : String -> List Char -> Maybe (List Char)
parseOrElse : Maybe (a, List Char) -> Maybe (a, List Char) -> Maybe (a, List Char)
parseListElems : (List Char -> Maybe (a, List Char)) -> List Char -> Maybe (List a, List Char)
Parse the elements of a list after the opening [ — empty ], or a comma-separated sequence ending in ]. The element parser rd is supplied by the caller.
parseListMore : (List Char -> Maybe (a, List Char)) -> List a -> List Char -> Maybe (List a, List Char)