Skip to content

[#301] Add traceShowWith#303

Merged
chshersh merged 2 commits intokowainik:masterfrom
sushi-shi:301-add-traceShowWith
Jun 5, 2020
Merged

[#301] Add traceShowWith#303
chshersh merged 2 commits intokowainik:masterfrom
sushi-shi:301-add-traceShowWith

Conversation

@sushi-shi
Copy link
Copy Markdown
Contributor

@sushi-shi sushi-shi commented Jun 4, 2020

Resolves #301

Checklist:

HLint

  • I've changed the exposed interface (add new reexports, remove reexports, rename reexported things, etc.).
    • I've updated hlint.dhall accordingly to my changes (add new rules for the new imports, remove old ones, when they are outdated, etc.).
    • I've generated the new .hlint.yaml file (see this instructions).

General

  • I've updated the CHANGELOG with the short description of my latest changes.
  • All new and existing tests pass.
  • I keep the code style used in the files I've changed (see style-guide for more details).
  • I've used the stylish-haskell file.
  • My change requires the documentation updates.
    • I've updated the documentation accordingly.
  • I've added the [ci skip] text to the docs-only related commit's name.

Copy link
Copy Markdown
Contributor

@hint-man hint-man bot left a comment

Choose a reason for hiding this comment

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

There is no place for me here... I will choose the truth I like.

Copy link
Copy Markdown
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

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

Nicely done, @sheepfleece 👍
I have only one suggestion to improve the example 🙂

Comment on lines +128 to +130
>>> fst $ traceShowWith fst (1, id)
1
1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice example! But I think that it would make the meaning of the traceShowWith function even clearer if we won't use fst on the result

Suggested change
>>> fst $ traceShowWith fst (1, id)
1
1
>>> traceShowWith fst (1, "ABC")
1
(1,"ABC")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, but with this I wanted to explicitly point out that you can use this function on things which do not have Show instance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can add the second example as well if you wish, but for the more clear picture of this function, it makes sense to show it in the way I mentioned above as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added both examples.

@vrom911 vrom911 added the new Bring something new into library (add function or type or interface) label Jun 4, 2020
@chshersh chshersh merged commit e78ed44 into kowainik:master Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new Bring something new into library (add function or type or interface)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'traces' function

3 participants