
parse :: String -> [Command]
parse str = map toCommand $ chunksOf 2 $ words str
  where
    toCommand [dir, dist] = (toDirective dir, read dist)
    toDirective "forward" = Forward
    toDirective "down" = Down
    toDirective "up" = Up

solve part commands = horiz * depth