Add Binary instances
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user