class Puz p where
  code :: p -> String

instance Puz (Point 2 Float) where
--  code p = show (p ^. unsafeCoord 1) ++ " " ++ show (p ^. unsafeCoord 2)
  code p = unwords $ map (show . (flip view p) . unsafeCoord) [1, 2]

instance Puz PuzPath where
  code (Start p) = "  start " ++ code p
  code (LineTo path p) = code path ++ "\n  " ++ "line to " ++ code p
  code (ArcTo path left wide p) = code path ++ "\n  " ++ if left then "left " else "" 
                                                      ++ if wide then "wide " else ""
                                                      ++ "arc to " ++ code p 

instance Puz PuzModifier where