-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small adjustment in CLI #399
Conversation
exe/wallet/Main.hs
Outdated
TIO.hPutStr stderr "" | ||
else do | ||
TIO.hPutStrLn stderr "Ok." | ||
BL8.putStrLn (encode a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rational / requirement for the silentMode
🤔 ?
Also, avoid Bool
where you can and favor a concrete data-type that conveys the semantic better:
data Mode = Silent | Verbose
Although here, I don't think we need this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, I'll suggest to:
- split
runClient
into two smaller functions:sendRequest
handleResponse
This way, you may re-use sendRequest
easily to check that a wallet exists without doing all the standard handling.
ecbe286
to
fc547e4
Compare
…sking for passphrase in case wallet does not exist
fc547e4
to
07cd348
Compare
07cd348
to
0dd4c0e
Compare
ts | ||
(ApiT wPwd) | ||
res <- sendRequest $ getWallet $ ApiT wId | ||
if (isRight res) then do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor thing but pattern-matching case res of Right _; Left _;
is more idiomatic in Haskell than if isXXX then else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Issue Number
#397
#398
Overview
Comments