diff options
Diffstat (limited to 'execs/Day02.hs')
-rw-r--r-- | execs/Day02.hs | 14 |
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 @@ | |||
1 | module Main where | 1 | module Main where |
2 | 2 | ||
3 | import Text.ParserCombinators.Parsec | 3 | import Text.Parsec.Char |
4 | import Text.Parsec.Char | 4 | import Text.ParserCombinators.Parsec |
5 | import Utils | 5 | import Utils |
6 | 6 | ||
7 | type PassProp = (Int, Int, Char, String) | 7 | type PassProp = (Int, Int, Char, String) |
8 | 8 | ||
9 | parseInt :: Parser Int | 9 | parseInt :: Parser Int |
10 | parseInt = read <$> many1 digit | 10 | parseInt = read <$> many1 digit |
11 | parseProp :: Parser PassProp | 11 | parseProp :: Parser PassProp |
12 | parseProp = (,,,) | 12 | parseProp = (,,,) |
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 | ||
18 | doCheck1 :: PassProp -> Bool | 18 | doCheck1 :: PassProp -> Bool |