Merge branch 'master' into 205-klausuren

This commit is contained in:
Gregor Kleen 2019-05-27 20:03:29 +02:00
commit ad36aca8cf
3 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,4 @@
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module CryptoID

View File

@ -11,6 +11,11 @@ import Data.Binary.SerializationLength
import Data.CaseInsensitive (CI)
import System.FilePath (FilePath)
import Data.Binary (Binary)
import qualified Data.Binary as Binary
import Database.Persist.Sql
decCryptoIDs :: [Name] -> DecsQ
decCryptoIDs = fmap concat . mapM decCryptoID
@ -21,6 +26,11 @@ decCryptoIDs = fmap concat . mapM decCryptoID
instance HasFixedSerializationLength $(t) where
type SerializationLength $(t) = SerializationLength Int64
instance {-# OVERLAPPING #-} Binary $(t) where
put = Binary.put . fromSqlKey
putList = Binary.putList . map fromSqlKey
get = toSqlKey <$> Binary.get
type instance CryptoIDNamespace a $(t) = $(litT $ strTyLit ns)
|]

View File

@ -1,4 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE UndecidableInstances #-}
module Database.Persist.Class.Instances
(