-
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 #77
Merge IOHK fork #77
Conversation
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.
eb75dae
to
49d8559
Compare
c2ee7e8
to
736b88a
Compare
42c5e0b
to
e167f83
Compare
TODO fix type error in |
TODO #74 (comment) |
When i load the code into GHCI i get
import Data.Eq (Eq) fixed it for me |
@flip111 , I don't see that error. Are you on GHC 9.2 or higher? If not, would you try using the Nix Flake?
|
More detail about #77 (comment) Using the parent repository currently, Haskell
generates PureScript
That is correct. In this PR,
generates PureScript
. |
fix build of `RoundTrip` test format tweaks remove deprecated `Generics` library WIP fixing tests copy unit tests from IOHK fork fixing tests clean-up fix Newtype, Lens imports fixing tests fix remove duplicate tests improve `CodeGenSwitches` work-in-progress `purescript-argonaut-aeson-generic` instances https://pursuit.purescript.org/packages/purescript-argonaut-aeson-generic/0.4.1 fix argonaut-aeson-generic support improve ordering of printed instances fix spaces prisms and lenses more test fixing fix `Maybe(..)` import fix line printing fix Newtype imports fix explicit aliased imports fix `Lens'` and `Newtype` imports fix example fix RoundTrip test lint disable certain warnings type parameters in `example` `spago` compiles example successfully `DecodeJsonField` eskimor@c55622e is not supported yet We want the result to be the same as https://github.com/eskimor/purescript-bridge/blob/ee0582aed3e5b62ea25b1079dee2c31b949381e7/example/src/Types.purs#L88-L93
latest `haskell-flake` also uses https://github.com/thomashoneyman/purescript-overlay
80a36b0
to
52facab
Compare
replaced by #89 |
Closes #63
Uses https://hackage.haskell.org/package/wl-pprint-text-1.2.0.2
Merge is not complete yet