From f5b489084e197b15f50fe659a382d9ec73276a7d Mon Sep 17 00:00:00 2001 From: Stephan Barth Date: Mon, 26 Feb 2024 18:30:08 +0100 Subject: [PATCH] Versionbump: Removed instances of bad type that can be derived automatically --- src/CryptoID.hs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/CryptoID.hs b/src/CryptoID.hs index 9d724bbee..07dba582c 100644 --- a/src/CryptoID.hs +++ b/src/CryptoID.hs @@ -72,8 +72,10 @@ instance {-# OVERLAPS #-} PathPiece (E.CryptoID "Submission" (CI FilePath)) wher instance {-# OVERLAPS #-} ToJSON (E.CryptoID "Submission" (CI FilePath)) where toJSON = String . toPathPiece -instance {-# OVERLAPS #-} ToJSONKey (E.CryptoID "Submission" (CI FilePath)) where - toJSONKey = ToJSONKeyText toPathPiece (text . toPathPiece) +instance {-# OVERLAPS #-} ToJSONKey (E.CryptoID "Submission" (CI FilePath)) +-- Versionbump: Instance can be made automatically now; also old instance does not work any more due to type changes +--where +-- toJSONKey = ToJSONKeyText toPathPiece (text . toPathPiece) instance {-# OVERLAPS #-} FromJSON (E.CryptoID "Submission" (CI FilePath)) where parseJSON = withText "CryptoFileNameSubmission" $ maybe (fail "Could not parse CryptoFileNameSubmission") return . fromPathPiece instance {-# OVERLAPS #-} FromJSONKey (E.CryptoID "Submission" (CI FilePath)) where @@ -91,8 +93,11 @@ instance {-# OVERLAPS #-} PathPiece (E.CryptoID "User" (CI FilePath)) where instance {-# OVERLAPS #-} ToJSON (E.CryptoID "User" (CI FilePath)) where toJSON = String . toPathPiece -instance {-# OVERLAPS #-} ToJSONKey (E.CryptoID "User" (CI FilePath)) where - toJSONKey = ToJSONKeyText toPathPiece (text . toPathPiece) +instance {-# OVERLAPS #-} ToJSONKey (E.CryptoID "User" (CI FilePath)) +-- Versionbump: Instance can be made automatically now; also old instance does not work any more due to type changes +-- where +-- toJSONKey = ToJSONKeyText toPathPiece (text . toPathPiece) + instance {-# OVERLAPS #-} FromJSON (E.CryptoID "User" (CI FilePath)) where parseJSON = withText "CryptoFileNameUser" $ maybe (fail "Could not parse CryptoFileNameUser") return . fromPathPiece instance {-# OVERLAPS #-} FromJSONKey (E.CryptoID "User" (CI FilePath)) where @@ -109,11 +114,13 @@ instance {-# OVERLAPS #-} PathPiece (E.CryptoID "PrintJob" (CI FilePath)) where toPathPiece = Text.pack . ("uwl" <>) . CI.foldedCase . ciphertext instance {-# OVERLAPS #-} ToJSON (E.CryptoID "PrintJob" (CI FilePath)) where toJSON = String . toPathPiece -instance {-# OVERLAPS #-} ToJSONKey (E.CryptoID "PrintJob" (CI FilePath)) where - toJSONKey = ToJSONKeyText toPathPiece (text . toPathPiece) +instance {-# OVERLAPS #-} ToJSONKey (E.CryptoID "PrintJob" (CI FilePath)) +-- Versionbump: Instance can be made automatically now; also old instance does not work any more due to type changes +-- where +-- toJSONKey = ToJSONKeyText toPathPiece (text . toPathPiece) instance {-# OVERLAPS #-} FromJSON (E.CryptoID "PrintJob" (CI FilePath)) where parseJSON = withText "CryptoFileNameUser" $ maybe (fail "Could not parse CryptoPrintJob") return . fromPathPiece instance {-# OVERLAPS #-} FromJSONKey (E.CryptoID "PrintJob" (CI FilePath)) where fromJSONKey = FromJSONKeyTextParser $ maybe (fail "Could not parse CryptoPrintJob") return . fromPathPiece instance {-# OVERLAPS #-} ToMarkup (E.CryptoID "PrintJob" (CI FilePath)) where - toMarkup = toMarkup . toPathPiece \ No newline at end of file + toMarkup = toMarkup . toPathPiece