aboutsummaryrefslogtreecommitdiff
path: root/execs/Day02.hs
diff options
context:
space:
mode:
Diffstat (limited to 'execs/Day02.hs')
-rw-r--r--execs/Day02.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/execs/Day02.hs b/execs/Day02.hs
index 412d1d1..43f6e31 100644
--- a/execs/Day02.hs
+++ b/execs/Day02.hs
@@ -1,18 +1,18 @@
1module Main where 1module Main where
2 2
3import Text.ParserCombinators.Parsec 3import Text.Parsec.Char
4import Text.Parsec.Char 4import Text.ParserCombinators.Parsec
5import Utils 5import Utils
6 6
7type PassProp = (Int, Int, Char, String) 7type PassProp = (Int, Int, Char, String)
8 8
9parseInt :: Parser Int 9parseInt :: Parser Int
10parseInt = read <$> many1 digit 10parseInt = read <$> many1 digit
11parseProp :: Parser PassProp 11parseProp :: Parser PassProp
12parseProp = (,,,) 12parseProp = (,,,)
13 <$> parseInt <* char '-' 13 <$> parseInt <* char '-'
14 <*> parseInt <* space 14 <*> parseInt <* space
15 <*> letter <* string ": " 15 <*> letter <* string ": "
16 <*> many letter 16 <*> many letter
17 17
18doCheck1 :: PassProp -> Bool 18doCheck1 :: PassProp -> Bool