31 lines
650 B
Haskell
31 lines
650 B
Haskell
{-# LANGUAGE NamedFieldPuns #-}
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
|
module Player (
|
|
Key
|
|
, T(..)
|
|
) where
|
|
|
|
import Data.Text (Text)
|
|
import qualified Data (Key)
|
|
import GHC.Generics
|
|
|
|
data T = T {
|
|
name :: Text
|
|
} deriving (Eq, Ord, Generic)
|
|
type Key = Data.Key T
|
|
|
|
{-
|
|
instance FromJSON Key
|
|
instance ToJSON Key where
|
|
toEncoding = genericToEncoding JSON.defaultOptions
|
|
|
|
instance ToJSONKey Key where
|
|
toJSONKey = toJSONKeyText (pack . \(Key n) -> show n)
|
|
|
|
instance FromJSON Name
|
|
instance ToJSON Name where
|
|
toEncoding = genericToEncoding JSON.defaultOptions
|
|
-}
|