Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Flare where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Color
|
||||
import Geometry
|
||||
import Control.Lens
|
||||
@@ -17,5 +20,8 @@ data Flare
|
||||
, _flareTran3 :: Point3
|
||||
, _flareTime :: Int
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Flare where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Flare
|
||||
makeLenses ''Flare
|
||||
|
||||
Reference in New Issue
Block a user