Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-12-01 17:34:14 +05:30
commit 45347bf88b
9 changed files with 196 additions and 0 deletions

10
lib/AoC.hs Normal file
View File

@@ -0,0 +1,10 @@
module AoC where
import Text.Parsec
extract :: Either ParseError a -> a
extract (Left err) = error ("Parsing failed: " ++ show err)
extract (Right val) = val
count :: (Eq a) => a -> [a] -> Int
count x = length . filter (x ==)