Move from store to flat

This commit is contained in:
2022-08-20 17:54:35 +01:00
parent 8571ab9254
commit ff9dbdf068
95 changed files with 793 additions and 748 deletions
+6 -6
View File
@@ -1,8 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Picture.Data where
import Flat
import LinearHelp
import Control.Lens
import Data.Aeson
@@ -19,7 +22,7 @@ data Verx = Verx
, _vxLayer :: !Layer
, _vxShadNum :: !ShadNum
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Layer
= BottomLayer
@@ -28,7 +31,7 @@ data Layer
| BloomNoZWrite
| DebugLayer
| FixedCoordLayer
deriving (Eq, Ord, Enum, Bounded, Show, Read)
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Flat)
layerNum :: Layer -> Int
layerNum = fromEnum
@@ -37,7 +40,7 @@ numLayers :: Int
numLayers = length [minBound :: Layer .. maxBound]
newtype ShadNum = ShadNum {_unShadNum :: Int}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
{-# INLINE polyNum #-}
@@ -91,6 +94,3 @@ makeLenses ''Verx
deriveJSON defaultOptions ''Verx
deriveJSON defaultOptions ''Layer
deriveJSON defaultOptions ''ShadNum
$($(derive [d| instance Deriving (Store Verx) |]))
$($(derive [d| instance Deriving (Store Layer) |]))
$($(derive [d| instance Deriving (Store ShadNum) |]))