Visitar URL original
Add `--censor` switch for disabling source code display by Gabriella439 · Pull Request #1312 · dhall-lang/dhall-haskell · GitHub
Skip to content

Add --censor switch for disabling source code display - #1312

Merged
mergify[bot] merged 3 commits into
masterfrom
gabriel/censor
Sep 14, 2019
Merged

mergify[bot] merged 3 commits into
masterfrom
gabriel/censor

Conversation

@Gabriella439

Copy link
Copy Markdown
Collaborator

Related to #1294

This currently only affects parse errors, but can later be extended
to type errors, too

Related to #1294

This currently only affects parse errors, but can later be extended
to type errors, too

@sjakobi sjakobi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example what the errors look like with --censor?

I suspect that this might elide more than is strictly required for #1294. But that can be addressed later on.

Comment thread dhall/src/Dhall/Util.hs Outdated

-- | Convenient utility for retrieving an expression
getExpression
:: Bool

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A dedicated CensorMode or similar would probably be more readable.

Comment thread dhall/src/Dhall/Util.hs Outdated
getExpression
:: Bool
-- ^ Censor the source code?
-> Maybe FilePath

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing arguments also smell a bit like boolean blindness to me. IMHO the straightforward fix would be to have both getExpressionFromFile and getExpressionFromStdin, but it's not important to me.

... as requested by @sjakobi

* Replace `Bool` with `Censor`
* Replace `Maybe FilePath` with `Input`
@mergify
mergify Bot merged commit 79bd32e into master Sep 14, 2019
@mergify
mergify Bot deleted the gabriel/censor branch September 14, 2019 05:02
@sjakobi

sjakobi commented Sep 14, 2019

Copy link
Copy Markdown
Collaborator

Many thanks for the much nicer types! :)

@Gabriella439

Copy link
Copy Markdown
Collaborator Author

@sjakobi: You're welcome! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants