[hs] Solve 2019_06
This commit is contained in:
parent
f0faf2f591
commit
589eced514
3 changed files with 67 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ module Aoc.Parse
|
|||
, untilSpace
|
||||
, untilEol
|
||||
, lineChar
|
||||
, word
|
||||
, digit
|
||||
) where
|
||||
|
||||
|
|
@ -41,6 +42,9 @@ untilEol = takeWhileP (Just "non-newline character") (/= '\n')
|
|||
lineChar :: Parser Char
|
||||
lineChar = label "non-newline character" $ satisfy (/= '\n')
|
||||
|
||||
word :: Parser T.Text
|
||||
word = takeWhileP (Just "alphanumeric character") isAlphaNum
|
||||
|
||||
digit :: Num a => Parser a
|
||||
digit = foldr1 (<|>)
|
||||
[ 0 <$ char '0'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue