Skip to content
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

Quieter show for newtypes. #24

Merged
merged 8 commits into from
Mar 24, 2020

Conversation

jonathanknowles
Copy link
Contributor

@jonathanknowles jonathanknowles commented Mar 23, 2020

Related Issue

Tangentially related to #21.

Summary

This small PR makes it easier to work with cardano-coin-selection interactively.

It reduces the verbosity of show for several newtypes, so that accessor function names are not included in the output.

Before applying this PR:

> divvyFee (Fee 15) $ fmap Coin [1, 2, 4, 8]
[(Fee {getFee = 1},Coin {getCoin = 1}),(Fee {getFee = 2},Coin {getCoin = 2}),(Fee {getFee = 4},Coin {getCoin = 4}),(Fee {getFee = 8},Coin {getCoin = 8})]

After applying this PR:

> divvyFee (Fee 15) $ fmap Coin [1, 2, 4, 8]
[(Fee 1,Coin 1),(Fee 2,Coin 2),(Fee 4,Coin 4),(Fee 8,Coin 8)]

@jonathanknowles jonathanknowles self-assigned this Mar 23, 2020
@jonathanknowles jonathanknowles changed the title Jonathanknowles/quieter show for newtypes Quieter show for newtypes. Mar 23, 2020
Copy link
Contributor

@paweljakubas paweljakubas left a comment

Choose a reason for hiding this comment

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

lgtm! I am more and more fond of derivingVia

@jonathanknowles
Copy link
Contributor Author

lgtm! I am more and more fond of derivingVia

Me too!

@jonathanknowles jonathanknowles merged commit 511637a into master Mar 24, 2020
@jonathanknowles jonathanknowles deleted the jonathanknowles/quieter-show-for-newtypes branch March 24, 2020 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants