-
Notifications
You must be signed in to change notification settings - Fork 325
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
Allow creation of user-defined TypeMapping's. #172
Conversation
Hi @rblaze, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
We would just have to bump the GBC version number to reflect the change or bundle it on the next release which already a different version number. The failed travis iteration is not related to this PR. |
As a side note, it would be great to have next release, also because of aeson version bump. Currently bond can't be built with stackage lts-6 because of it. |
Exactly, 0.12 works just fine. |
@@ -17,7 +17,7 @@ type system of a target programming language. | |||
module Language.Bond.Codegen.TypeMapping | |||
( -- * Mapping context | |||
MappingContext(..) | |||
, TypeMapping | |||
, TypeMapping(..) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeMapping
also refers to TypeNameBuilder
. While we don't need to export that from the module because it's just a type alias, doing so would allow you to use TypeNameBuilder
instead of Reader MappingContext Builder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment for TypeMapping
needs to be updated. It's no longer opaque.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also worth considering if we shouldn't export some of the helpers that are usually needed to create a TypeMapping
. In particular I'm thinking about elementTypeName
, instanceTypeName
, annotatedTypeName
, aliasTypeName
, declTypeName
and declQualifiedTypeName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this, pushed updated commit.
I think it looks good, the only nit I see is the new uncommented functions (elementTypeName, instanceTypeName, annotatedTypeName, aliasTypeName, declTypeName and declQualifiedTypeName) since I noticed a pattern that if its exposed it has a small comment. |
Could you provide me with descriptions to add? I'm a bit struggling to come up with good ones. |
How about something along these lines:
Also I think we actually don't need to export |
I need one to create Haskell-stype qualified names, but can't create it, and have to reimplement several functions.
Updated pull request. |
LGTM. I'll merge this tomorrow. |
@rblaze, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
Version 0.5.0.0 of the bond package is now live on Hackage. That version includes this change. |
I need one to create Haskell-stype qualified names, but can't create it, and have to reimplement several functions.