aboutsummaryrefslogtreecommitdiff
path: root/2020/02-Password_Philosophy/second.hs
diff options
context:
space:
mode:
Diffstat (limited to '2020/02-Password_Philosophy/second.hs')
-rw-r--r--2020/02-Password_Philosophy/second.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/2020/02-Password_Philosophy/second.hs b/2020/02-Password_Philosophy/second.hs
index 973a818..35ec555 100644
--- a/2020/02-Password_Philosophy/second.hs
+++ b/2020/02-Password_Philosophy/second.hs
@@ -25,15 +25,12 @@ parseRule = do
void (char ' ')
e <- anySingle
void (string ": ")
- pass <- (many letterChar)
+ pass <- (some letterChar)
void (char '\n')
return Rule { lower = (read l) - 1, higher = (read h) - 1, elt = e, pass = pass }
parseRules :: Parser [Rule]
-parseRules = do
- rules <- many parseRule
- eof
- return rules
+parseRules = some parseRule <* eof
parseInput :: String -> IO [Rule]
parseInput filename = do