Skip to content

Operator aliases for data constructors#1890

Merged
garyb merged 1 commit intomasterfrom
dctor-operator-aliases
Feb 22, 2016
Merged

Operator aliases for data constructors#1890
garyb merged 1 commit intomasterfrom
dctor-operator-aliases

Conversation

@garyb
Copy link
Copy Markdown
Member

@garyb garyb commented Feb 21, 2016

Still needs work 😉

-- will be removed.
--
| ParensInBinder Binder
-- |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't really made use of this yet, as the parsing is not correct, but I assume we'll need something like this to enable fixity overriding as with the normal operators?

@garyb garyb force-pushed the dctor-operator-aliases branch 6 times, most recently from 832585e to fdf3af2 Compare February 21, 2016 21:41
@garyb
Copy link
Copy Markdown
Member Author

garyb commented Feb 21, 2016

Ok, I think this is good to review now. Do you know what's going on with the errors Travis keeps giving? Something about aeson? It's been building locally without errors or warnings for me for the last few pushes, yet keeps failing on Travis.

renderSimpleErrorMessage (TransitiveDctorExportError x ctor) =
paras [ line $ "An export for " ++ prettyPrintExport x ++ " requires the following data constructor to also be exported: "
, indent $ line $ runProperName ctor
]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this with a new error message as we can't really generate a good error message for the export using a DeclarationRef and the TransitiveDctorExportError, as it would mean doing quite a bit of work to figure out if the type for the data constructor is already exported, and also what data constructors are exported for that type. Also TransitiveDctorExportError doesn't print data constructors currently, for some other complicated reasons (data constructors for the types in here are error sometimes).

@garyb garyb force-pushed the dctor-operator-aliases branch from fdf3af2 to a816913 Compare February 21, 2016 22:22
@garyb
Copy link
Copy Markdown
Member Author

garyb commented Feb 21, 2016

Ok, so there was a mistake in that last commit that was causing a failure despite what I said 😉

The test suite is still failing locally for me, but I have no idea why, as I can't interpret the output anymore. Having scanned through it I see nothing appears to be failing in the psc tests, but it still comes out with Test suite tests: FAIL, so something in docs or publish? I don't know what the docs test output means (like, are the things it prints failures or just a log of what it's doing?), and the publish test output is empty.

@garyb
Copy link
Copy Markdown
Member Author

garyb commented Feb 21, 2016

Oh, it fails in master too...

@hdgarrood
Copy link
Copy Markdown
Contributor

That might be my fault. Some of the tests print to stderr, and some print to stdout, so the actual error might be a few lines back (I am hoping to fix this soon). Otherwise, I can a look at this tomorrow if you'd like.

@garyb
Copy link
Copy Markdown
Member Author

garyb commented Feb 21, 2016

I was about to ask if you had any ideas actually, as the tests started failing once infer-docs-types-2 was merged 😉: https://travis-ci.org/purescript/purescript/builds/110685540

@garyb
Copy link
Copy Markdown
Member Author

garyb commented Feb 21, 2016

Ok, well it seems Travis is happy now even though it isn't locally. Weird!


import qualified Language.PureScript.Constants as C

type AliasName = Either (Qualified Ident) (Qualified (ProperName 'ConstructorName))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some short comments here?

@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Feb 22, 2016

👍 Looks great to me!

@garyb garyb force-pushed the dctor-operator-aliases branch from a816913 to ee2e7ce Compare February 22, 2016 09:41
@garyb garyb force-pushed the dctor-operator-aliases branch from ee2e7ce to 9a377c4 Compare February 22, 2016 11:49
@garyb
Copy link
Copy Markdown
Member Author

garyb commented Feb 22, 2016

Rebased & I added some comments for AliasName, etc.

garyb added a commit that referenced this pull request Feb 22, 2016
Operator aliases for data constructors
@garyb garyb merged commit 47d547d into master Feb 22, 2016
@garyb garyb deleted the dctor-operator-aliases branch February 22, 2016 20:06
@texastoland texastoland mentioned this pull request Mar 6, 2016
@rgrempel rgrempel mentioned this pull request May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants