-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
386 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
Check warning Code scanning / HLint Unused LANGUAGE pragma Warning
cardano-cli/src/Cardano/CLI/Polysemy.hs:3:1-34: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE OverloadedStrings #-} Perhaps you should remove it. |
||
{-# LANGUAGE TypeApplications #-} | ||
Check warning Code scanning / HLint Unused LANGUAGE pragma Warning
cardano-cli/src/Cardano/CLI/Polysemy.hs:4:1-33: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE TypeApplications #-} Perhaps you should remove it. |
||
{-# LANGUAGE TypeOperators #-} | ||
Check warning Code scanning / HLint Unused LANGUAGE pragma Warning
cardano-cli/src/Cardano/CLI/Polysemy.hs:5:1-30: Warning: Unused LANGUAGE pragma
Found: {-# LANGUAGE TypeOperators #-} Perhaps you should remove it. Note: may require {-# LANGUAGE ExplicitNamespaces #-} adding to the top of the file |
||
|
||
module Cardano.CLI.Polysemy | ||
( ByronKeyFailure(..), | ||
ByronKeyFormat(..), | ||
SigningKeyFile, | ||
File(..), | ||
FileDirection(..), | ||
readByronSigningKey | ||
) where | ||
|
||
import Cardano.Api.Byron (SomeByronSigningKey (..)) | ||
|
||
import Cardano.CLI.Byron.Key (ByronKeyFailure (..)) | ||
import qualified Cardano.CLI.Byron.Key as Cli | ||
import Cardano.CLI.Types.Common | ||
|
||
import Control.Monad.Except (runExceptT) | ||
|
||
import HaskellWorks.Polysemy | ||
import HaskellWorks.Polysemy.Prelude | ||
import Polysemy () | ||
|
||
readByronSigningKey :: () | ||
=> Member (Error ByronKeyFailure) r | ||
=> Member (Embed IO) r | ||
=> ByronKeyFormat | ||
-> SigningKeyFile In | ||
-> Sem r SomeByronSigningKey | ||
readByronSigningKey bKeyFormat fp = | ||
(embed $ runExceptT $ Cli.readByronSigningKey bKeyFormat fp) | ||
& onLeftM throw | ||
Check notice Code scanning / HLint Move brackets to avoid $ Note
cardano-cli/src/Cardano/CLI/Polysemy.hs:(35,3)-(36,19): Suggestion: Move brackets to avoid $
Found: (embed $ runExceptT $ Cli.readByronSigningKey bKeyFormat fp) & onLeftM throw Perhaps: embed (runExceptT $ Cli.readByronSigningKey bKeyFormat fp) & onLeftM throw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.