advent-of-code/2023/day02/Main.hs
2024-12-01 05:55:27 +01:00

27 lines
428 B
Haskell

import Data.Char
import Data.List
type Parser a = String -> [(a, String)]
char :: Parser Char
char [] = []
char (x:xs) = [(x, xs)]
failure :: Parser a
failure = (\a -> [])
return :: Parser a
return v inp = [(v, inp)]
parse :: Parser a -> String -> [(a, String)]
parse p inp = p inp
main :: IO ()
main = do
inputLines <- lines <$> getContents
-- let arePossible = filter isPossible lines
mapM_ putStrLn inputLines