diff options
Diffstat (limited to 'spec/src/Thermoprint')
-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 |