From 4bd52914304c421fcb89fa9f4550a241968e18c2 Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 24 Jan 2018 19:58:22 +0000 Subject: [PATCH] Ignore newlines at beginning of file --- src/Cards.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cards.hs b/src/Cards.hs index c424e8e..c62fba1 100644 --- a/src/Cards.hs +++ b/src/Cards.hs @@ -330,7 +330,7 @@ element time = comment <|> (ECard <$> pCard time) "element" -- Use this parser if you want nice error messages to display. parseElements :: UTCTime -> Parser Elements parseElements time = do - elms <- (element time `sepEndBy` some newline) <* label "end of file" eof + elms <- many newline *> (element time `sepEndBy` some newline) <* label "end of file" eof return $ Elements $ Map.fromList $ zip [1..] elms -- | The 'parseElements' parser, but simpler to use.