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
Closed

Pretty-print of UnexpectedEvent is backward #84

khumba opened this issue Jun 9, 2016 · 2 comments

Comments

@khumba
Copy link
Contributor

khumba 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
Copy link
Owner

snoyberg 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
Copy link
Contributor Author

khumba 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 added a commit that referenced this issue Jun 9, 2016
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants