aboutsummaryrefslogtreecommitdiff
path: root/server/src/Thermoprint/Server/Database.hs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/Thermoprint/Server/Database.hs')
-rw-r--r--server/src/Thermoprint/Server/Database.hs15
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
9module Thermoprint.Server.Database 10module 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
17import Control.DeepSeq 17import Control.DeepSeq
@@ -32,8 +32,15 @@ Draft
32 content Printout 32 content Printout
33|] 33|]
34 34
35deriving instance Enum (Key Job)
36deriving instance Num (Key Job)
37deriving instance Real (Key Job)
38deriving instance Integral (Key Job)
39
40deriving instance Enum (Key Draft)
41deriving instance Num (Key Draft)
42deriving instance Real (Key Draft)
43deriving instance Integral (Key Draft)
44
35instance NFData (Key Job) where 45instance NFData (Key Job) where
36 rnf = rnf . unSqlBackendKey . unJobKey 46 rnf = rnf . unSqlBackendKey . unJobKey
37
38castId' :: Enum b => BackendKey SqlBackend -> b
39castId' = castId . unSqlBackendKey