From 6e2883f57decbdcc8cbfefb8cdd9b118212811d5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 25 Jan 2016 17:50:00 +0000 Subject: cleaned up castId --- server/src/Thermoprint/Server/Database.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'server/src/Thermoprint/Server/Database.hs') 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 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} module Thermoprint.Server.Database @@ -11,7 +12,6 @@ module Thermoprint.Server.Database , Draft(..), DraftId , Key(..) , migrateAll - , castId' ) where import Control.DeepSeq @@ -32,8 +32,15 @@ Draft content Printout |] +deriving instance Enum (Key Job) +deriving instance Num (Key Job) +deriving instance Real (Key Job) +deriving instance Integral (Key Job) + +deriving instance Enum (Key Draft) +deriving instance Num (Key Draft) +deriving instance Real (Key Draft) +deriving instance Integral (Key Draft) + instance NFData (Key Job) where rnf = rnf . unSqlBackendKey . unJobKey - -castId' :: Enum b => BackendKey SqlBackend -> b -castId' = castId . unSqlBackendKey -- cgit v1.2.3