isCons → NonEmpty

This commit is contained in:
rhiannon morris 2022-05-04 15:30:37 +02:00
parent 2d7110b9c6
commit 96e81584b6

View file

@ -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)