[hs] Move parsing stuff to Aoc.Parse
This commit is contained in:
parent
b87c8e4555
commit
320fc25e06
2 changed files with 23 additions and 4 deletions
21
hs/src/Aoc/Parse.hs
Normal file
21
hs/src/Aoc/Parse.hs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
module Aoc.Parse
|
||||
( module Text.Megaparsec
|
||||
, module Text.Megaparsec.Char
|
||||
, module Text.Megaparsec.Char.Lexer
|
||||
, Parser
|
||||
, manyLines
|
||||
) where
|
||||
|
||||
import Data.Void
|
||||
|
||||
import qualified Data.Text as T
|
||||
import Text.Megaparsec
|
||||
import Text.Megaparsec.Char
|
||||
import Text.Megaparsec.Char.Lexer (binary, decimal, float,
|
||||
hexadecimal, octal, scientific,
|
||||
signed)
|
||||
|
||||
type Parser = Parsec Void T.Text
|
||||
|
||||
manyLines :: Parser a -> Parser [a]
|
||||
manyLines p = sepBy p newline <* optional newline <* eof
|
||||
Loading…
Add table
Add a link
Reference in a new issue