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.TeslaArc where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Geometry.Data
|
||||
import Color
|
||||
import Control.Lens
|
||||
@@ -11,5 +14,8 @@ data TeslaArc = TeslaArc
|
||||
, _taArcSteps :: [ArcStep]
|
||||
, _taColor :: Color
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON TeslaArc where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON TeslaArc
|
||||
makeLenses ''TeslaArc
|
||||
|
||||
Reference in New Issue
Block a user