Add Read instances
This commit is contained in:
+5
-4
@@ -1,9 +1,11 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Picture.Data
|
||||
where
|
||||
import Geometry.Data
|
||||
|
||||
import GHC.Generics
|
||||
import Control.Lens
|
||||
import Streaming
|
||||
data Verx = Verx
|
||||
@@ -13,8 +15,7 @@ data Verx = Verx
|
||||
, _vxLayer :: !Layer
|
||||
, _vxShadNum :: !ShadNum
|
||||
}
|
||||
deriving (Eq,Ord,Show)
|
||||
--newtype LayNum = LayNum { _unLayNum :: Int }
|
||||
deriving (Eq,Ord,Show,Generic,Read)
|
||||
|
||||
data Layer
|
||||
= BottomLayer
|
||||
@@ -23,7 +24,7 @@ data Layer
|
||||
| BloomNoZWrite
|
||||
| DebugLayer
|
||||
| FixedCoordLayer
|
||||
deriving (Eq,Ord,Enum,Bounded,Show)
|
||||
deriving (Eq,Ord,Enum,Bounded,Show,Generic,Read)
|
||||
|
||||
layerNum :: Layer -> Int
|
||||
layerNum = fromEnum
|
||||
@@ -31,7 +32,7 @@ numLayers :: Int
|
||||
numLayers = length [minBound::Layer .. maxBound]
|
||||
--TODO use synonyms for layer numbers
|
||||
newtype ShadNum = ShadNum { _unShadNum :: Int }
|
||||
deriving (Eq,Ord,Show)
|
||||
deriving (Eq,Ord,Show,Generic,Read)
|
||||
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
|
||||
{-# INLINE polyNum #-}
|
||||
{-# INLINE polyzNum #-}
|
||||
|
||||
Reference in New Issue
Block a user