Introduce operator aliases#1691
Conversation
48f8f57 to
9ebd3a0
Compare
There was a problem hiding this comment.
So this needs an update to Pursuit, correct? Or is this a backwards-compatible change? Does perhaps handle undefined fields?
Maybe we need to bump the min compiler version there. /cc @hdgarrood
There was a problem hiding this comment.
Apparently not, perhaps is kind of like purescript's Data.Foreign.Null.readNull: https://hackage.haskell.org/package/aeson-better-errors-0.9.0/docs/Data-Aeson-BetterErrors.html#v:perhaps
But there is also keyMay, which would give you Nothing if the property wasn't there, so as far as I can tell, if we used that, we would probably be able to keep accepting uploads from people on 0.7.x. I'm not really sure about what to do here; it's hard to predict whether that would be worth doing.
By the way, does this line up with the ToJSON instance? You can run the test in psc-publish/test to do a quick to-JSON-and-back test. (I should make that into an actual test.) I think this might be using Aeson's ToJSON (,) instance at the moment, which might not work with this parser.
|
I like it! I tried this before but didn't think of the renaming-after-reordering approach for some reason, which threw me off. Agreed about handling this in codegen, but this is great for now. Prelude changes sound good to me, but why 1.0? Don't we want to wait until other things are ready and bump everything together? |
9ebd3a0 to
46d1713
Compare
|
Updated - It would seem that using |
There was a problem hiding this comment.
Just checking: once we require operators to be defined as aliases for other existing values, this addDefaultFixity function will no longer be necessary, right?
46d1713 to
7c51c99
Compare
7c51c99 to
8d3b8b3
Compare
|
Switched to use |
|
Ok - I'll try to fix those tests up and integrate them into the normal test suite. |
|
@garyb can you cherry-pick hdgarrood@4ab687c? |
|
@hdgarrood done! (A while back actually, Travis is pretty slow currently). Weirdly failing in just one of the test setups... |
|
Ah, looks like that new module |
|
@hdgarrood because |
|
Ah, of course - thanks. |
531fecc to
ab7e5f6
Compare
|
That did it, thanks. I think this is ready to go if you're happy then @paf31? |
|
👍 Looks great! |

Resolves #806
This probably isn't the best way of handling it in the long term, it would be nice to desugar during codegen rather than upfront as we'll probably get better error messages that way, but while we're supporting both old and new syntax this seemed a reasonable approach for now.