From 93da8ade3b3b92b51a2adfd14d223ce074258498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Thu, 16 Jan 2025 11:10:36 +0100 Subject: [PATCH] Value.hs: remove useless usage of ViewPatterns --- cardano-api/internal/Cardano/Api/Value.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cardano-api/internal/Cardano/Api/Value.hs b/cardano-api/internal/Cardano/Api/Value.hs index 9fc9f18607..6b5204531b 100644 --- a/cardano-api/internal/Cardano/Api/Value.hs +++ b/cardano-api/internal/Cardano/Api/Value.hs @@ -5,7 +5,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE ViewPatterns #-} -- | Currency values module Cardano.Api.Value @@ -387,13 +386,15 @@ instance FromJSON ValueNestedRep where where parsePid :: (Aeson.Key, Aeson.Value) -> Parser ValueNestedBundle parsePid ("lovelace", q) = ValueNestedBundleAda <$> parseJSON q - parsePid (Aeson.toText -> pid, quantityBundleJson) = do + parsePid (key, quantityBundleJson) = do sHash <- failEitherWith (\e -> "Failure when deserialising PolicyId: " ++ displayError e) $ deserialiseFromRawBytesHex AsScriptHash $ Text.encodeUtf8 pid ValueNestedBundle (PolicyId sHash) <$> parseJSON quantityBundleJson + where + pid = Aeson.toText key -- ---------------------------------------------------------------------------- -- Printing and pretty-printing