From e3ea039428545e185b38c5633fe3576ab32f1f8e Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 16 Jan 2025 19:22:18 -0800 Subject: Cleans excessive type annotations --- hsm-core/Hsm/Core/Env.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'hsm-core/Hsm/Core/Env.hs') diff --git a/hsm-core/Hsm/Core/Env.hs b/hsm-core/Hsm/Core/Env.hs index 4e7986f..8ef7464 100644 --- a/hsm-core/Hsm/Core/Env.hs +++ b/hsm-core/Hsm/Core/Env.hs @@ -3,9 +3,9 @@ module Hsm.Core.Env , deriveFromYaml ) where -import Data.Aeson (FromJSON, Result(Error, Success), Value, fromJSON) +import Data.Aeson (FromJSON, Result(Error, Success), fromJSON) import Data.Aeson.Key (fromText) -import Data.Aeson.KeyMap (KeyMap, (!?)) +import Data.Aeson.KeyMap ((!?)) import Data.Aeson.TH (defaultOptions, deriveFromJSON, rejectUnknownFields) import Data.Maybe (fromMaybe) import Data.Text (Text, unpack) @@ -15,13 +15,10 @@ import Language.Haskell.TH (Dec, Name, Q) environment :: FromJSON env => Text -> Text -> IO env environment name = fmap (check . fromJSON . load) . decodeFileThrow . unpack where - load :: KeyMap Value -> Value load keymap = fromMaybe (error $ "Service configuration for " <> unpack name <> " not found)") $ keymap !? fromText name - -- - check :: Result env -> env check (Success env) = env check (Error str) = error str -- cgit v1.2.1