diff options
author | Paul Oliver <contact@pauloliver.dev> | 2025-01-16 19:22:18 -0800 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2025-01-17 19:16:43 -0800 |
commit | e3ea039428545e185b38c5633fe3576ab32f1f8e (patch) | |
tree | 56ab8d1248b4387ceab6094305e7a75699c4e393 /hsm-core/Hsm/Core/Env.hs | |
parent | e1fa79eb713c249055fb23fcc6684a94f77d8368 (diff) |
Cleans excessive type annotations
Diffstat (limited to 'hsm-core/Hsm/Core/Env.hs')
-rw-r--r-- | hsm-core/Hsm/Core/Env.hs | 7 |
1 files changed, 2 insertions, 5 deletions
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 |