kowainik / typerep-map

⚡️Efficient implementation of Map with types as keys
https://kowainik.github.io/projects/typerep-map
Mozilla Public License 2.0
97 stars 17 forks source link

Write function O-notation in prettier way using latex #55

Open chshersh opened 5 years ago

chshersh commented 5 years ago

Haddock supports that.

cronokirby commented 5 years ago

Where exactly are the ocurrences of this?

chshersh commented 5 years ago

@cronokirby The functions that require documentation improvements are here:

The same should be done for TMap module:

You can see example of how asymptotic specified in this PR:

0xd34df00d commented 4 years ago

I guess I can give this a shot.

chshersh commented 4 years ago

Hi @0xd34df00d! Did you have time to work on this? Let us know if you stuck on something and need some further details or clarifications :slightly_smiling_face:

0xd34df00d commented 4 years ago

@chshersh oh, I realized there're no complexity annotations right now, and I don't think I'm qualified enough to produce them off the top of my head! Did I miss something by any chance?

chshersh commented 4 years ago

@0xd34df00d Hmm, indeed, I can see how this can be challenging. No worries then! :slightly_smiling_face:

ChrisPenner commented 3 years ago

@chshersh @0xd34df00d I've been adding complexity annotations as I touch functions and think I probably have the context loaded up to just go through and add them all if that'd help here.

There are a few spots where some additional explanation is needed due to optimizations (at least after the work in a few of my other PRs); for instance alter changes its asymptotics based on the function you pass it; all operations have a base log factor, then if you delete it's O(n); if you update it's O(1), if you insert it's O(n) haha; so the function itself technically has a worst bound of O(n); but can be O(1) in many common cases 🤷 .

At any rate; some explanation is likely better than no explanation 😄

chshersh commented 3 years ago

@ChrisPenner Thanks for working on this! I believe, only a few functions will require O-notation annotations after your awesome work :muscle:

Haddock supports LaTeX, and I'd love to have O-notations formatted using pretty formulas as we did in relude for the Nub module for example: