-
Notifications
You must be signed in to change notification settings - Fork 49
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
Merge IOHK fork #89
Open
peterbecich
wants to merge
118
commits into
eskimor:master
Choose a base branch
from
peterbecich:merge-iohk-3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Merge IOHK fork #89
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For generic decoding, `Decode (Foo a)` needs a `Decode a` constraint, but it *doesn't* need a `Generic a` constraint. Adding in this unnecessary constraint creates needless problems like, "there isn't an instance for `Generic String _`."
PureScript isn't happy with eta-reduced typeclass instances on recursive types. We have to make the function application explicit.
…y (Container A)`. The generated code will include an `Eq a =>` constraint.
* Sum types where every constructor has zero arguments. Aeson has special handling for these.
For generic decoding, `Decode (Foo a)` needs a `Decode a` constraint, but it *doesn't* need a `Generic a` constraint. Adding in this unnecessary constraint creates needless problems like, "there isn't an instance for `Generic String _`."
…xy (Container A)`. The generated code will include an `Ord a =>` constraint.
It turns out you can't eta-reduce typeclass instances for recursively-defined typeclasses in PureScript. That is: `show = genericShow` ...has to be replaced with: `show x = genericShow` ...to work reliably. See: purescript/purescript#2975
That is, `(genericShow <*> mkSumType) (Proxy @(Foo A))` will generate: ``` instance showFoo :: Show a => Show (Foo a) where show = genericShow ``` ...whereas before it would have missed out the `Show a` constraint.
peterbecich
force-pushed
the
merge-iohk-3
branch
3 times, most recently
from
February 25, 2024 04:59
a356fe0
to
6f5008a
Compare
peterbecich
added a commit
to flip111/purescript-bridge
that referenced
this pull request
Feb 25, 2024
Fix show instances for unused type variables
peterbecich
force-pushed
the
merge-iohk-3
branch
3 times, most recently
from
February 25, 2024 22:55
ec99e1b
to
28053d1
Compare
TODO |
peterbecich
force-pushed
the
merge-iohk-3
branch
from
February 26, 2024 00:27
8d8a1b0
to
4439ef6
Compare
@peterbecich did you look at the problem of |
peterbecich
added a commit
to peterbecich/purescript-bridge
that referenced
this pull request
Mar 31, 2024
peterbecich
force-pushed
the
merge-iohk-3
branch
from
March 31, 2024 06:43
8c372c0
to
f2e973c
Compare
@flip111 , in progress, thanks |
@peterbecich thanks. Need any more help? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#63
CodeGenSwitches
no longer usedProxy
no longer usedPrinter
usesLeijen.Text
instead ofText
genericShow
PureScript instanceShow
#85instanceToImportLines
instead of being divided between two modulesRoundTrip
tests implemented by IOHKjson-helpers
and exposes issuesTODO
check that derivedGeneric
instances are correctfixRoundTrip
testsome other broken testsThe PR supports https://github.com/input-output-hk/purescript-bridge-json-helpers and the existing library https://github.com/coot/purescript-argonaut-aeson-generic
The issues with
purescript-argonaut-aeson-generic
are documented in the readme. Importantly, these issues exist onmaster
right now without the PR, so I think it should not block merging. Discussion purescript-contrib/purescript-argonaut-codecs#115 (comment)The other library https://github.com/paf31/purescript-foreign-generic continues to be supported, but the test coverage is much less than the other two.