Remove unused Player.T type

This commit is contained in:
Sasha 2018-04-12 23:05:58 +02:00
parent 59f8751fb6
commit 1d7a680d48
1 changed files with 0 additions and 20 deletions

View File

@ -6,8 +6,6 @@ module Player (
, Name
, Session(..)
, Status(..)
, T(..)
, new
, openSession
) where
@ -22,18 +20,6 @@ import GHC.Generics
newtype Key = Key Int deriving (Eq, Ord, Read, Show, Generic)
newtype Name = Name Text deriving (Eq, Ord, Generic)
data T = T {
key :: Key
, name :: Name
}
deriving (Generic)
instance Data.RW Key T where
update f player@(T {key}) = player {key = f key}
instance Data.RW Name T where
update f player@(T {name}) = player {name = f name}
instance FromJSON Key
instance ToJSON Key where
toEncoding = genericToEncoding JSON.defaultOptions
@ -45,9 +31,6 @@ instance FromJSON Name
instance ToJSON Name where
toEncoding = genericToEncoding JSON.defaultOptions
instance ToJSON T where
toEncoding = genericToEncoding JSON.defaultOptions
data Status =
LoggedIn Bool
| Answering Key
@ -62,9 +45,6 @@ data Session = Session {
instance Data.RW Status Session where
update f session@(Session {status}) = session {status = f status}
new :: Key -> Name -> T
new key name = T {key, name}
openSession :: Connection -> Session
openSession connection = Session {
connection