isCons → NonEmpty
This commit is contained in:
parent
2d7110b9c6
commit
96e81584b6
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ skip lex = match lex $ const Nothing
|
||||||
simple : List String -> a -> Tokenizer (Maybe a)
|
simple : List String -> a -> Tokenizer (Maybe a)
|
||||||
simple str = match (choice $ map exact str) . const . Just
|
simple str = match (choice $ map exact str) . const . Just
|
||||||
|
|
||||||
choice : (xs : List (Tokenizer a)) -> {auto 0 _ : So (isCons xs)} -> Tokenizer a
|
choice : (xs : List (Tokenizer a)) -> {auto 0 _ : NonEmpty xs} -> Tokenizer a
|
||||||
choice (t :: ts) = foldl (\a, b => a <|> b) t ts
|
choice (t :: ts) = foldl (\a, b => a <|> b) t ts
|
||||||
|
|
||||||
match : Lexer -> (String -> a) -> Tokenizer (Maybe a)
|
match : Lexer -> (String -> a) -> Tokenizer (Maybe a)
|
||||||
|
|
Loading…
Reference in a new issue