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

Don't export class methods by default #56

Open
aherrmann opened this issue Oct 3, 2018 · 4 comments
Open

Don't export class methods by default #56

aherrmann opened this issue Oct 3, 2018 · 4 comments

Comments

@aherrmann
Copy link
Member

The methods of the capability type-classes (e.g. put_ from HasState) are not meant to be used directly, currently this is documented in their haddocks. With the separation of user facing modules and internal modules, such as Capability.State and Capability.State.Internal.Class, it is possible to not export them from the user facing modules.

We should consistently separate user facing from internal modules (e.g. Capability.Writer vs Capability.Writer.Internal.Class) and not export class methods in the user facing modules.


cc @mrkkrp

@aspiwack
Copy link
Member

aspiwack commented Oct 3, 2018

(I don't know what the class would not be in Capability.Writer.Internal)

The class methods are not an internal thing however, they very much matter if you need to define manual instances of the capabilities.

It may be worth it not to export them in main modules because it can be considered avanced usage, and, possibly, it may make the documentation more approachable (though, a typeclass without methods may throw people off as well). But in that case, the type class should be exported in its entirety in some non-internal module (I don't have a name for this module at this point).

@mrkkrp
Copy link
Member

mrkkrp commented Oct 4, 2018

For consistency, I'd expect every capability to have an internal module.

@aspiwack
Copy link
Member

aspiwack commented Oct 4, 2018

I don't think internal modules should have any sort of consistency. They are, by definition, not part of my API. Rather, use-at-your-own-risk extras.

@mrkkrp
Copy link
Member

mrkkrp commented Oct 4, 2018

Why not have consistency in extras too :-D

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

3 participants