27 lines
428 B
Haskell
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
|
|
|