Skip to content

Use consistent notation for complexity annotation #729

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

Merged
merged 7 commits into from
Jun 19, 2020

Conversation

alexfmpe
Copy link
Contributor

Fix #722

@treeowl
Copy link
Contributor

treeowl commented Jun 11, 2020

One of these modules somewhere uses MathJax. Let's make them all do that.

@sjakobi
Copy link
Member

sjakobi commented Jun 17, 2020

One of these modules somewhere uses MathJax. Let's make them all do that.

@treeowl Could you clarify what you mean here?

FWIW, what I was looking for in this PR was a proper fix for #722. Any other possible haddock improvements don't need to happen in this PR IMHO.

@treeowl
Copy link
Contributor

treeowl commented Jun 17, 2020

One of these modules somewhere uses MathJax. Let's make them all do that.

@treeowl Could you clarify what you mean here?

Look how all the math is formatted in Data.Sequence. Let's do that everywhere.

@sjakobi
Copy link
Member

sjakobi commented Jun 17, 2020

Look how all the math is formatted in Data.Sequence. Let's do that everywhere.

Oh yeah. That does look nicer! I'd argue that this is a different issue than what this PR was about though.

Copy link
Member

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

Two more tweaks, otherwise LGTM.

@alexfmpe
Copy link
Contributor Author

Look how all the math is formatted in Data.Sequence. Let's do that everywhere.

If that's the convention going forward, I might as well make these particular annotations conform to it now

Co-authored-by: Simon Jakobi <simon.jakobi@gmail.com>
@sjakobi
Copy link
Member

sjakobi commented Jun 17, 2020

Look how all the math is formatted in Data.Sequence. Let's do that everywhere.

If that's the convention going forward, I might as well make these particular annotations conform to it now

I wouldn't mind. I don't currently volunteer to update the remaining annotations though.

@sjakobi
Copy link
Member

sjakobi commented Jun 17, 2020

Could you share another screenshot, @alexfmpe? I think you're somehow using fewer backslashes than the annotations in Data.Sequence tend to have.

Here are the docs BTW: https://haskell-haddock.readthedocs.io/en/latest/markup.html#mathematics-latex

@alexfmpe
Copy link
Contributor Author

Good catch, the log/min functions were being rendered as variables

@alexfmpe
Copy link
Contributor Author

intmap
map

Copy link
Member

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

Gorgeous! Many thanks! :)

@sjakobi
Copy link
Member

sjakobi commented Jun 17, 2020

I've made #731 where we can track the remaining annotations to convert.

@sjakobi sjakobi merged commit 13d2a41 into haskell:master Jun 19, 2020
@treeowl
Copy link
Contributor

treeowl commented Jun 19, 2020

Why did the complexity info move?

@sjakobi
Copy link
Member

sjakobi commented Jun 19, 2020

Why did the complexity info move?

That was my idea. It's much longer now, so it would have distracted from the function description if we had kept it in the old spot.

@treeowl
Copy link
Contributor

treeowl commented Jun 19, 2020

We need a good and consistent approach to that. As I recall, @m-renaud wants it always at the bottom. I'm skeptical about that, because the complexity of an operation seems like one of the most important things to know about it. But it's also true that a long complexity statement before the basic info about what an operation does is problematic. So I dunno.

@sjakobi
Copy link
Member

sjakobi commented Jun 19, 2020

Putting it consistently at the bottom (above the since-annotation?) sounds fine to me.

A closed PR doesn't seem like a good place to discuss this further though. Consider opening an issue?

@m-renaud
Copy link
Contributor

I was actually thinking about this the other day, we have the @since metadata which has a consistent rendering across packages, could we introduce standard @complexity and @complexityInfo annotations and do something similar. Agreed that this is probably not the best place to discuss though.

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.

Mysterious complexity annotations for compose
4 participants