Add file
This commit is contained in:
@@ -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 ++ ")"
|
||||
Reference in New Issue
Block a user