haskell / vector

An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework .
Other
367 stars 139 forks source link

Use MathJax format for complexity annotations #431

Closed konsumlamm closed 2 years ago

konsumlamm commented 2 years ago

I did the following changes, via search & replace:

Additionally i formatted complexities that previously had no formatting and some manual changes (see the second commit).

konsumlamm commented 2 years ago

@lehins @Shimuuar what do you think?

lehins commented 2 years ago

@konsumlamm Just by itself it doesn't look too much different from before this PR, however if you can do this search and replace to \(\mathcal{O}(...)\) instead, which is the way it is done in Data.List, that would be awesome! What do you think?

konsumlamm commented 2 years ago

Sure, I can do that.

Bodigrim commented 2 years ago

It's perfectly valid and much more common to use O instead of \mathcal{O}, which is a very recent innovation. All classic books from Knuth to Okasaki use an old plain O and I do not really see a good reason to diverge.

lehins commented 2 years ago

It's perfectly valid and much more common

This new big O typesetting is already used in base haddock, and if we add this to vector it'll make it pretty common in Haskell ecosystem.

which is a very recent innovation

Nothing is wrong with using innovations

All classic books from Knuth to Okasaki use an old plain O and I do not really see a good reason to diverge.

I see a reason. It looks pretty!

So @Bodigrim, we have a perfectly valid PR that I like and you don't, what do we do now? @Shimuuar any input?

Shimuuar commented 2 years ago

Personally I would use plain O. Easier to type, easier to read in source. But I don't really have opinion about this. Either way is fine

lehins commented 2 years ago

Fair enough. Sorry @konsumlamm, despite that I am all for this cute big O, we live in a democracy with the other two maintainers, and both of them expressed preference in favor of the plain O. If you'll able to persuade them, you have my vote, but for now I have to close this PR.