-- Parsing
-playerP = ("1" *> pure Player1) <|> ("2" *> pure Player2)
+playerP = (Player1 <$ "1") <|> (Player2 <$ "2")
playerStateP = playerify <$> ("Player " *> playerP) <*> (" starting position: " *> decimal)
where playerify name pos = (name, PlayerState {position = pos, score = 0})
}
vecify [c1, c2, c3] = V3 c1 c2 c3
-partiyP = ("on" *> pure On) <|> ("off" *> pure Off)
+-- partiyP = ("on" *> pure On) <|> ("off" *> pure Off)
+partiyP = (On <$ "on") <|> (Off <$ "off")
boundsP = (,) <$> (("x" <|> "y" <|> "z") *> "=" *> signed decimal) <*> (".." *> signed decimal)
registerP, wP, xP, yP, zP :: Parser Register
registerP = choice [wP, xP, yP, zP]
-wP = "w" *> pure W
-xP = "x" *> pure X
-yP = "y" *> pure Y
-zP = "z" *> pure Z
+wP = W <$ "w"
+xP = X <$ "x"
+yP = Y <$ "y"
+zP = Z <$ "z"
argumentP :: Parser Argument
argumentP = (Reg <$> registerP) <|> (Lit <$> signed decimal)