Add Store instances
This commit is contained in:
+5
-3
@@ -5,6 +5,8 @@
|
||||
|
||||
module Picture.Data where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
@@ -22,7 +24,6 @@ data Verx = Verx
|
||||
, _vxShadNum :: !ShadNum
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Verx
|
||||
|
||||
data Layer
|
||||
= BottomLayer
|
||||
@@ -32,7 +33,6 @@ data Layer
|
||||
| DebugLayer
|
||||
| FixedCoordLayer
|
||||
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Flat)
|
||||
instance Binary Layer
|
||||
|
||||
layerNum :: Layer -> Int
|
||||
layerNum = fromEnum
|
||||
@@ -42,7 +42,7 @@ numLayers = length [minBound :: Layer .. maxBound]
|
||||
|
||||
newtype ShadNum = ShadNum {_unShadNum :: Int}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary ShadNum
|
||||
$($(derive [d| instance Deriving (Store ShadNum) |]))
|
||||
|
||||
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
|
||||
{-# INLINE polyNum #-}
|
||||
@@ -96,3 +96,5 @@ makeLenses ''Verx
|
||||
deriveJSON defaultOptions ''Verx
|
||||
deriveJSON defaultOptions ''Layer
|
||||
deriveJSON defaultOptions ''ShadNum
|
||||
$($(derive [d| instance Deriving (Store Verx ) |]))
|
||||
$($(derive [d| instance Deriving (Store Layer) |]))
|
||||
|
||||
Reference in New Issue
Block a user