diff --git a/src/ShortShow.hs b/src/ShortShow.hs new file mode 100644 index 000000000..10da46b37 --- /dev/null +++ b/src/ShortShow.hs @@ -0,0 +1,17 @@ +module ShortShow where +import Geometry + +--import Data.Typeable +import Numeric + +class ShortShow a where + shortShow :: a -> String + +instance ShortShow a => ShortShow (V2 a) where + shortShow (V2 x y) = shortShow x ++ "#" ++ shortShow y + +instance ShortShow Float where + shortShow x = showFFloat (Just 2) x "" + +instance (ShortShow a,ShortShow b) => ShortShow (a,b) where + shortShow (a,b) = '(' : shortShow a ++ "," ++ shortShow b ++ ")"