diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-23 12:45:43 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-23 12:45:43 +0000 |
commit | 5273512b68c67eff2c8e869f84dad1c4d69e16a8 (patch) | |
tree | e9e653ac9a049e2433d345c4ae2fb7a0d59429ab /spec | |
parent | 6348b2fb57b291b925ce27e9070eecc10d560608 (diff) | |
download | thermoprint-5273512b68c67eff2c8e869f84dad1c4d69e16a8.tar thermoprint-5273512b68c67eff2c8e869f84dad1c4d69e16a8.tar.gz thermoprint-5273512b68c67eff2c8e869f84dad1c4d69e16a8.tar.bz2 thermoprint-5273512b68c67eff2c8e869f84dad1c4d69e16a8.tar.xz thermoprint-5273512b68c67eff2c8e869f84dad1c4d69e16a8.zip |
read instances to facilitate persistent storage
Diffstat (limited to 'spec')
-rw-r--r-- | spec/src/Thermoprint/API.hs | 4 | ||||
-rw-r--r-- | spec/src/Thermoprint/Identifiers.hs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/src/Thermoprint/API.hs b/spec/src/Thermoprint/API.hs index 6c86008..00115f3 100644 --- a/spec/src/Thermoprint/API.hs +++ b/spec/src/Thermoprint/API.hs | |||
@@ -52,10 +52,10 @@ data JobStatus = Queued PrinterId | |||
52 | | Printing PrinterId | 52 | | Printing PrinterId |
53 | | Done | 53 | | Done |
54 | | Failed PrintingError | 54 | | Failed PrintingError |
55 | deriving (Generic, Show, FromJSON, ToJSON) | 55 | deriving (Generic, Show, Read, FromJSON, ToJSON) |
56 | 56 | ||
57 | data PrintingError = UnknownError | 57 | data PrintingError = UnknownError |
58 | deriving (Typeable, Generic, Show, FromJSON, ToJSON, Exception) | 58 | deriving (Typeable, Generic, Show, Read, FromJSON, ToJSON, Exception) |
59 | 59 | ||
60 | type DraftTitle = Text | 60 | type DraftTitle = Text |
61 | 61 | ||
diff --git a/spec/src/Thermoprint/Identifiers.hs b/spec/src/Thermoprint/Identifiers.hs index a2609a4..ee35e24 100644 --- a/spec/src/Thermoprint/Identifiers.hs +++ b/spec/src/Thermoprint/Identifiers.hs | |||
@@ -12,13 +12,13 @@ import Servant.API (ToText, FromText) | |||
12 | import Data.Aeson (FromJSON, ToJSON) | 12 | import Data.Aeson (FromJSON, ToJSON) |
13 | 13 | ||
14 | newtype PrinterId = PrinterId Integer | 14 | newtype PrinterId = PrinterId Integer |
15 | deriving (Show, Eq, Ord, Num, Real, Integral, Enum, FromText, ToText, FromJSON, ToJSON) | 15 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromText, ToText, FromJSON, ToJSON) |
16 | 16 | ||
17 | newtype JobId = JobId Integer | 17 | newtype JobId = JobId Integer |
18 | deriving (Show, Eq, Ord, Num, Real, Integral, Enum, FromText, ToText, FromJSON, ToJSON) | 18 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromText, ToText, FromJSON, ToJSON) |
19 | 19 | ||
20 | newtype DraftId = DraftId Integer | 20 | newtype DraftId = DraftId Integer |
21 | deriving (Show, Eq, Ord, Num, Real, Integral, Enum, FromText, ToText, FromJSON, ToJSON) | 21 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromText, ToText, FromJSON, ToJSON) |
22 | 22 | ||
23 | castId :: (Integral a, Enum b) => a -> b | 23 | castId :: (Integral a, Enum b) => a -> b |
24 | castId = toEnum . fromInteger . toInteger | 24 | castId = toEnum . fromInteger . toInteger |