diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-07 14:16:21 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-07 14:16:21 +0100 |
commit | 7065a8cc1b8b01cd32d4b1d5317b323fec5238bd (patch) | |
tree | d6608f463b066aa6caf33357fd9ae0e508e49084 /spec/src | |
parent | 75d9fe614dca572aa1d7cfa53553e9c103eb2dd0 (diff) | |
download | thermoprint-7065a8cc1b8b01cd32d4b1d5317b323fec5238bd.tar thermoprint-7065a8cc1b8b01cd32d4b1d5317b323fec5238bd.tar.gz thermoprint-7065a8cc1b8b01cd32d4b1d5317b323fec5238bd.tar.bz2 thermoprint-7065a8cc1b8b01cd32d4b1d5317b323fec5238bd.tar.xz thermoprint-7065a8cc1b8b01cd32d4b1d5317b323fec5238bd.zip |
Bump versions
Diffstat (limited to 'spec/src')
-rw-r--r-- | spec/src/Thermoprint/API.hs | 8 | ||||
-rw-r--r-- | spec/src/Thermoprint/Identifiers.hs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/spec/src/Thermoprint/API.hs b/spec/src/Thermoprint/API.hs index 8e98db8..5b24e54 100644 --- a/spec/src/Thermoprint/API.hs +++ b/spec/src/Thermoprint/API.hs | |||
@@ -55,11 +55,11 @@ import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary(..)) | |||
55 | import Test.QuickCheck.Gen (scale, variant, oneof) | 55 | import Test.QuickCheck.Gen (scale, variant, oneof) |
56 | import Test.QuickCheck.Instances | 56 | import Test.QuickCheck.Instances |
57 | 57 | ||
58 | instance (Integral k, Ord k, ToJSON v) => ToJSON (Map k v) where | 58 | -- instance (Integral k, Ord k, ToJSON v) => ToJSON (Map k v) where |
59 | toJSON = toJSON . Map.foldMapWithKey (IntMap.singleton . castId) | 59 | -- toJSON = toJSON . Map.foldMapWithKey (IntMap.singleton . castId) |
60 | 60 | ||
61 | instance (Enum k, Ord k, FromJSON v) => FromJSON (Map k v) where | 61 | -- instance (Enum k, Ord k, FromJSON v) => FromJSON (Map k v) where |
62 | parseJSON = fmap (IntMap.foldMapWithKey $ Map.singleton . castId) . parseJSON | 62 | -- parseJSON = fmap (IntMap.foldMapWithKey $ Map.singleton . castId) . parseJSON |
63 | 63 | ||
64 | data PrinterStatus = Busy JobId | 64 | data PrinterStatus = Busy JobId |
65 | | Available | 65 | | Available |
diff --git a/spec/src/Thermoprint/Identifiers.hs b/spec/src/Thermoprint/Identifiers.hs index 2a07318..e90602c 100644 --- a/spec/src/Thermoprint/Identifiers.hs +++ b/spec/src/Thermoprint/Identifiers.hs | |||
@@ -13,16 +13,16 @@ import GHC.Generics (Generic) | |||
13 | import Control.DeepSeq (NFData) | 13 | import Control.DeepSeq (NFData) |
14 | 14 | ||
15 | import Servant.API (ToHttpApiData, FromHttpApiData) | 15 | import Servant.API (ToHttpApiData, FromHttpApiData) |
16 | import Data.Aeson (FromJSON, ToJSON) | 16 | import Data.Aeson (FromJSON, ToJSON, FromJSONKey, ToJSONKey) |
17 | 17 | ||
18 | newtype PrinterId = PrinterId Integer | 18 | newtype PrinterId = PrinterId Integer |
19 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromHttpApiData, ToHttpApiData, FromJSON, ToJSON, Typeable, Generic, NFData) | 19 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromHttpApiData, ToHttpApiData, FromJSON, ToJSON, ToJSONKey, FromJSONKey, Typeable, Generic, NFData) |
20 | 20 | ||
21 | newtype JobId = JobId Integer | 21 | newtype JobId = JobId Integer |
22 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromHttpApiData, ToHttpApiData, FromJSON, ToJSON, Typeable, Generic, NFData) | 22 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromHttpApiData, ToHttpApiData, FromJSON, ToJSON, ToJSONKey, FromJSONKey, Typeable, Generic, NFData) |
23 | 23 | ||
24 | newtype DraftId = DraftId Integer | 24 | newtype DraftId = DraftId Integer |
25 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromHttpApiData, ToHttpApiData, FromJSON, ToJSON, Typeable, Generic, NFData) | 25 | deriving (Show, Read, Eq, Ord, Num, Real, Integral, Enum, FromHttpApiData, ToHttpApiData, FromJSON, ToJSON, ToJSONKey, FromJSONKey, Typeable, Generic, NFData) |
26 | 26 | ||
27 | castId :: (Integral a, Enum b) => a -> b | 27 | castId :: (Integral a, Enum b) => a -> b |
28 | castId = toEnum . fromInteger . toInteger | 28 | castId = toEnum . fromInteger . toInteger |