Skip to content

displayException: Remove trailing newline #37

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

Conversation

9999years
Copy link
Contributor

@9999years 9999years commented Apr 11, 2025

In #36, I restructured the AnnotatedException displayException implementation so that instead of being of the form:

displayException =
    unlines [ ... ] <> callStackMessage
    where
        callStackMessage = prettyCallStack frames

It was of the form:

displayException =
    unlines $ [ ... ] <> callStackMessage
    where
        callStackMessage = [prettyCallStack frames]

I didn't realize that unlines adds a trailing newline, which is generally the wrong behavior for displayException instances.

This change replaces unlines with concat . intersperse "\n" in order to regain the correct behavior.

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR.
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts).

In parsonsmatt#36, I restructured the `AnnotatedException` `displayException`
implementation so that instead of being of the form:

    displayException =
        unlines [ ... ] <> callStackMessage
        where
            callStackMessage = prettyCallStack frames

It was of the form:

    displayException =
        unlines $ [ ... ] <> callStackMessage
        where
            callStackMessage = [prettyCallStack frames]

I didn't realize that `unlines` adds a trailing newline, which is
generally the wrong behavior for `displayException` instances.

This change replaces `unlines` with `concat . intersperse "\n"` in order
to regain the correct behavior.
@9999years 9999years marked this pull request as ready for review April 11, 2025 18:21
@parsonsmatt parsonsmatt merged commit 805a0ac into parsonsmatt:master Apr 11, 2025
9 checks passed
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