Refactor, try to limit dependencies
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
--{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
--{-# LANGUAGE FlexibleInstances #-}
|
||||
--{-# LANGUAGE DeriveGeneric #-}
|
||||
module Dodge.Data.Material where
|
||||
import GHC.Generics
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data Material = Wood | Dirt | Stone | Glass | Metal | Crystal | Flesh | Electronics
|
||||
deriving (Eq,Ord,Show,Bounded,Enum,Read,Generic)
|
||||
instance ToJSON Material where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Material
|
||||
deriving (Eq, Ord, Show, Bounded, Enum, Read)
|
||||
|
||||
deriveJSON defaultOptions ''Material
|
||||
|
||||
Reference in New Issue
Block a user