summaryrefslogtreecommitdiff
path: root/2023/day02/Main.hs
blob: 5b235d29452d1e15b3c29c50e9c38ce0b4f05588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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