Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.CrWlID where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Control.Lens
|
||||
data CrWlID = CrID Int | WlID Int | NothingID -- TODO rewrite/remove this
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON CrWlID where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON CrWlID
|
||||
makeLenses ''CrWlID
|
||||
|
||||
Reference in New Issue
Block a user