-
Notifications
You must be signed in to change notification settings - Fork 9
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
Associate type to tags #65
Comments
Tags are poly-kinded. So, in such cases, we could use the type as a tag as well. For example:
|
Uh. Please no! Not doing that is sort of the entire point of tags to begin with. |
gdeest
pushed a commit
that referenced
this issue
May 2, 2019
Fixes #65. Introduces a poly-kinded type family to allow users to associate tags to type, and corresponding type synonyms for all capabilities to shorten constraint declarations.
gdeest
pushed a commit
that referenced
this issue
May 2, 2019
Fixes #65. Introduces a poly-kinded type family to allow users to associate tags to type, and corresponding type synonyms for all capabilities to shorten constraint declarations. Also changes the Reader example to make use of that feature.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we have to write
This is all fine for library, and basically necessary for deriving-via combinators. But it's a bit annoying in an application. Where typically, a tag correspond to a given type. e.g.
HasReader "config"
would always be followed by the same configuration type. Throughout the entire application. Meh 🙁 .We should do something about this.
At this point my idea looks a bit as follows. We define a type family
(with no instance in the library)
And type synonyms like
This way, you could define application-wide tag-to-type associations and have shorthands for them.
Or maybe, in order to avoid the lack of composability that symbol have, we could do
That way they can be defined without orphan instances.
Thoughts?
The text was updated successfully, but these errors were encountered: