Add Binary instances

This commit is contained in:
2022-08-21 10:58:19 +01:00
parent 386a2b4732
commit 1ce7d4a72d
95 changed files with 345 additions and 3 deletions
+6
View File
@@ -8,8 +8,10 @@
module Shape.Data where
import Data.Binary
import Control.Lens
import Data.Aeson
import Data.Binary
import Flat
import Geometry.Data
import LinearHelp ()
@@ -30,6 +32,7 @@ data ShapeObj = ShapeObj
, _shVs :: [ShapeV]
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary ShapeObj
instance ToJSON ShapeObj where
toEncoding = genericToEncoding defaultOptions
@@ -41,6 +44,8 @@ newtype ShapeType = TopPrism Int
deriving stock Generic
deriving anyclass Flat
instance Binary ShapeType
instance ToJSON ShapeType where
toEncoding = genericToEncoding defaultOptions
@@ -52,6 +57,7 @@ data ShapeV = ShapeV
, _svCol :: Point4
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary ShapeV
instance ToJSON ShapeV where
toEncoding = genericToEncoding defaultOptions