server/src/Player.hs

31 lines
650 B
Haskell
Raw Normal View History

2018-04-11 13:25:24 +02:00
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2018-04-11 13:25:24 +02:00
module Player (
Key
, T(..)
2018-04-11 13:25:24 +02:00
) where
import Data.Text (Text)
import qualified Data (Key)
2018-04-11 13:25:24 +02:00
import GHC.Generics
data T = T {
name :: Text
} deriving (Eq, Ord, Generic)
type Key = Data.Key T
2018-04-11 13:25:24 +02:00
{-
instance FromJSON Key
instance ToJSON Key where
2018-04-11 13:25:24 +02:00
toEncoding = genericToEncoding JSON.defaultOptions
instance ToJSONKey Key where
toJSONKey = toJSONKeyText (pack . \(Key n) -> show n)
2018-04-11 13:25:24 +02:00
instance FromJSON Name
instance ToJSON Name where
toEncoding = genericToEncoding JSON.defaultOptions
-}