Skip to content

Add support for user defined warnings via the Warn type class#2569

Merged
paf31 merged 2 commits intopurescript:masterfrom
LiamGoodacre:feature/user-defined-warnings
Jan 15, 2017
Merged

Add support for user defined warnings via the Warn type class#2569
paf31 merged 2 commits intopurescript:masterfrom
LiamGoodacre:feature/user-defined-warnings

Conversation

@LiamGoodacre
Copy link
Copy Markdown
Member

For #2564

[ "The Warn type class allows a custom compiler warning to be displayed."
, ""
, "For more information, see"
, "[the Custom Type Errors guide](https://github.com/purescript/documentation/blob/master/guides/Custom-Type-Errors.md)."
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm currently writing a quick overview of the feature for this page - I'll submit a PR to the docs repo when this one is merged.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@LiamGoodacre
Copy link
Copy Markdown
Member Author

Example output:

Compiling Main
[1/1 UserDefinedWarning] src/Main.purs:10:1

  10  bar :: Int
      ^^^^^^^^^^

  A custom warning occurred while solving type class constraints:

    "Bananas"

  in value declaration bar

           Src   Lib   All
Warnings   1     0     1
Errors     0     0     0
* Build successful.

Note that the message isn't printing in the right format due to #2568

@damncabbage
Copy link
Copy Markdown
Contributor

Nice!

Copy link
Copy Markdown
Contributor

@paf31 paf31 left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great!

@paf31 paf31 merged commit b70aabf into purescript:master Jan 15, 2017
@LiamGoodacre LiamGoodacre deleted the feature/user-defined-warnings branch January 15, 2017 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants