Skip to content

Make exportedDeclarations filter everything#1045

Closed
hdgarrood wants to merge 5 commits intopurescript:masterfrom
hdgarrood:issue-747
Closed

Make exportedDeclarations filter everything#1045
hdgarrood wants to merge 5 commits intopurescript:masterfrom
hdgarrood:issue-747

Conversation

@hdgarrood
Copy link
Copy Markdown
Contributor

fixes #747

I've added a test case to examples/manual/passing for testing the exportedDeclarations function.

Also, the new functions in Language.PureScript.AST.Declarations don't necessarily need to be exported; I put them at the top level so that there's fewer bound variables to worry about, and so that they can be tested in ghci. I would be happy to move them into a separate module to avoid them being exported if you think that's a good idea.

Fixes #747

In addition to its previous behaviour of filtering out declarations
which are not exported, `exportedDeclarations` will also:

* Filter out instance declarations which refer to non-exported types,
  as these can be considered as unexported.
* Descend into data declarations, and filter out unexported constructors

The effect of this is that tooling like psci and psc-docs can now simply
call `exportedDeclarations` and not have to worry about anything.
@hdgarrood
Copy link
Copy Markdown
Contributor Author

I've just come up with another approach which I like better:

  • Only export exportedDeclarations; all the other functions for testing exports are redundant now, as far as I can tell.
  • Move exportedDeclarations and all of the functions it requires into a separate module; Language.PureScript.AST.Exported perhaps.

@hdgarrood
Copy link
Copy Markdown
Contributor Author

Actually, I'm going to close this and resubmit to 0.7-dev after #1041 is merged, because changing the API like that will necessitate changes in psc-docs which would cause merge conflicts.

@hdgarrood hdgarrood closed this Apr 15, 2015
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.

Instances for private classes and types still appear in psc-docs output

1 participant