From da214ba266d8b2924f4e77530734f771bd38abe0 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Tue, 22 Sep 2020 17:33:15 +0200 Subject: [PATCH] added read instances --- tickLeiste-aeson/src/Data/Aeson/TickLeiste.hs | 4 ++-- tickLeiste/src/Data/TickLeiste.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tickLeiste-aeson/src/Data/Aeson/TickLeiste.hs b/tickLeiste-aeson/src/Data/Aeson/TickLeiste.hs index ee3cbf3..10541ba 100644 --- a/tickLeiste-aeson/src/Data/Aeson/TickLeiste.hs +++ b/tickLeiste-aeson/src/Data/Aeson/TickLeiste.hs @@ -22,7 +22,7 @@ data JSONRequest | TickLeisteR | ChangeNameR {cnaRplayerUUID :: U.UUID, cnaRplayerName :: T.Text} | RemovePlayerR {rmpRplayerUUID :: U.UUID} - deriving (Show,Eq) + deriving (Show, Eq, Read) $(deriveJSON defaultOptions {sumEncoding = defaultTaggedObject {tagFieldName = "requestType"}, fieldLabelModifier = drop 4} ''JSONRequest) @@ -32,6 +32,6 @@ data JSONEvent | InitializeTickLeisteE {itlEtickLeiste :: [(Tick, [(U.UUID, T.Text)])]} | ChangeNameE {cnaEplayerUUID :: U.UUID, cnaEplayerName :: T.Text} | RemovePlayerE {rmpEplayerUUID :: U.UUID} - deriving (Show,Eq) + deriving (Show, Eq, Read) $(deriveJSON defaultOptions {sumEncoding = defaultTaggedObject {tagFieldName = "eventType"}, fieldLabelModifier = drop 4} ''JSONEvent) diff --git a/tickLeiste/src/Data/TickLeiste.hs b/tickLeiste/src/Data/TickLeiste.hs index 385c39f..ef5a65d 100644 --- a/tickLeiste/src/Data/TickLeiste.hs +++ b/tickLeiste/src/Data/TickLeiste.hs @@ -28,7 +28,7 @@ import qualified Data.UUID as U -- | A Tick is just a number data Tick = Abwarten | Bereithalten | Tick Int - deriving (Show, Eq, Ord) + deriving (Show, Eq, Ord, Read) -- | test if 'Tick' is constructed using 'Abwarten' isAbwarten :: Tick -> Bool