command :: Parser Command
command
  =   try (Move    <$> (string "Move" *> spaces1 *> direction))
  <|> try (Lift    <$> (string "Lift" *> spaces1 *> int))
  <|> try (Drop    <$> (string "Drop" *> spaces1 *> int))
  <|> try (Inspect <$> (string "Inspect" *> spaces1 *> int))
  <|> try (Destroy <$> (string "Destroy" *> spaces1 *> int))
  <|> try (Build   <$> (string "Build" *> spaces1 *> listOf int <* spaces1) <*> memory)
  <|> try (string "Pass" *> pure Pass)
  <?> "a command"
command :: Parser Command
command
  =   try (Move    <$> (string "Move" *> spaces1 *> direction))
  <|> try (Lift    <$> (string "Lift" *> spaces1 *> int))
  <|> try (Drop    <$> (string "Drop" *> spaces1 *> int))
  <|> try (Inspect <$> (string "Inspect" *> spaces1 *> int))
  <|> try (Destroy <$> (string "Destroy" *> spaces1 *> int))
  <|> try (Build   <$> (string "Build" *> spaces1 *> listOf int <* spaces1) <*> memory)
  <|> try (string "Pass" *> pure Pass)
  <?> "a command"
command
  =   try (Move    <$> (string "Move" *> spaces1 *> direction))
  <|> try (Lift    <$> (string "Lift" *> spaces1 *> int))
  <|> try (Drop    <$> (string "Drop" *> spaces1 *> int))
  <|> try (Inspect <$> (string "Inspect" *> spaces1 *> int))
  <|> try (Destroy <$> (string "Destroy" *> spaces1 *> int))
  <|> try (Build   <$> (string "Build" *> spaces1 *> listOf int <* spaces1) <*> memory)
  <|> try (string "Pass" *> pure Pass)
  <?> "a command"