aboutsummaryrefslogtreecommitdiff
path: root/execs/Day02.hs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-12-16 07:27:38 +0000
committerAkshay <[email protected]>2020-12-16 07:27:38 +0000
commit8c1193fece01bb80e86d8cc36efcf8820a6ccb46 (patch)
treef13ed4cdb33e748f596db9b7e7a2b08d8b3ba0ef /execs/Day02.hs
parent38f3a717b0f8095fb05b9be0bebd158474eb7618 (diff)
format *
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