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

Pretty-print of UnexpectedEvent is backward #84

Closed
khumba opened this issue Jun 9, 2016 · 2 comments

Comments

@khumba
Copy link
Contributor

commented Jun 9, 2016

Hello! In Data.Yaml.Internal:

data ParseException = ...
                    | UnexpectedEvent { _received :: Maybe Event
                                      , _expected :: Maybe Event
                                      }

prettyPrintParseException :: ParseException -> String
prettyPrintParseException pe = case pe of
  ...
  UnexpectedEvent mbExpected mbUnexpected -> unlines
    [ "Unexpected event: expected"
    , "  " ++ show mbExpected
    , "but received"
    , "  " ++ show mbUnexpected
    ]

The fields appear to be in reverse order in UnexpectedEvent mbExpected mbUnexpected; at least, the error message I'm seeing doesn't make a lot of sense as is :).

@snoyberg

This comment has been minimized.

Copy link
Owner

commented Jun 9, 2016

Could catch, can you send a PR to fix that?

On Thu, Jun 9, 2016 at 8:47 AM, Bryan Gardiner notifications@github.com
wrote:

Hello! In Data.Yaml.Internal:

data ParseException = ...
| UnexpectedEvent { _received :: Maybe Event
, _expected :: Maybe Event
}

prettyPrintParseException :: ParseException -> String
prettyPrintParseException pe = case pe of
...
UnexpectedEvent mbExpected mbUnexpected -> unlines
[ "Unexpected event: expected"
, " " ++ show mbExpected
, "but received"
, " " ++ show mbUnexpected
]

The fields appear to be in reverse order in UnexpectedEvent mbExpected
mbUnexpected; at least, the error message I'm seeing doesn't make a lot
of sense as is :).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#84, or mute the thread
https://github.com/notifications/unsubscribe/AADBBwBYQ0hJfm9isy-ObTCKDCz4Uwb3ks5qJ6j0gaJpZM4Ixpjg
.

@khumba

This comment has been minimized.

Copy link
Contributor Author

commented Jun 9, 2016

Yes, for sure.

On Wed, 08 Jun 2016 23:09:32 -0700
Michael Snoyman notifications@github.com wrote:

Could catch, can you send a PR to fix that?

@snoyberg snoyberg closed this in 5b0bf4f Jun 9, 2016

snoyberg added a commit that referenced this issue Jun 9, 2016
Merge pull request #85 from khumba/unexpectedevent
Fix pretty-printing order of UnexpectedEvent's fields (fixes #84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.