diff options
Diffstat (limited to 'server/src/Thermoprint/Server/Database.hs')
-rw-r--r-- | server/src/Thermoprint/Server/Database.hs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/server/src/Thermoprint/Server/Database.hs b/server/src/Thermoprint/Server/Database.hs index 1e01680..5bd4512 100644 --- a/server/src/Thermoprint/Server/Database.hs +++ b/server/src/Thermoprint/Server/Database.hs | |||
@@ -4,6 +4,7 @@ | |||
4 | {-# LANGUAGE TypeFamilies #-} | 4 | {-# LANGUAGE TypeFamilies #-} |
5 | {-# LANGUAGE ExistentialQuantification #-} | 5 | {-# LANGUAGE ExistentialQuantification #-} |
6 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 6 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
7 | {-# LANGUAGE StandaloneDeriving #-} | ||
7 | {-# LANGUAGE FlexibleInstances #-} | 8 | {-# LANGUAGE FlexibleInstances #-} |
8 | 9 | ||
9 | module Thermoprint.Server.Database | 10 | module Thermoprint.Server.Database |
@@ -11,7 +12,6 @@ module Thermoprint.Server.Database | |||
11 | , Draft(..), DraftId | 12 | , Draft(..), DraftId |
12 | , Key(..) | 13 | , Key(..) |
13 | , migrateAll | 14 | , migrateAll |
14 | , castId' | ||
15 | ) where | 15 | ) where |
16 | 16 | ||
17 | import Control.DeepSeq | 17 | import Control.DeepSeq |
@@ -32,8 +32,15 @@ Draft | |||
32 | content Printout | 32 | content Printout |
33 | |] | 33 | |] |
34 | 34 | ||
35 | deriving instance Enum (Key Job) | ||
36 | deriving instance Num (Key Job) | ||
37 | deriving instance Real (Key Job) | ||
38 | deriving instance Integral (Key Job) | ||
39 | |||
40 | deriving instance Enum (Key Draft) | ||
41 | deriving instance Num (Key Draft) | ||
42 | deriving instance Real (Key Draft) | ||
43 | deriving instance Integral (Key Draft) | ||
44 | |||
35 | instance NFData (Key Job) where | 45 | instance NFData (Key Job) where |
36 | rnf = rnf . unSqlBackendKey . unJobKey | 46 | rnf = rnf . unSqlBackendKey . unJobKey |
37 | |||
38 | castId' :: Enum b => BackendKey SqlBackend -> b | ||
39 | castId' = castId . unSqlBackendKey | ||