typerep-map icon indicating copy to clipboard operation
typerep-map copied to clipboard

Write function O-notation in prettier way using latex

Open chshersh opened this issue 7 years ago • 8 comments

Haddock supports that.

chshersh avatar Sep 21 '18 04:09 chshersh

Where exactly are the ocurrences of this?

cronokirby avatar Oct 03 '18 17:10 cronokirby

@cronokirby The functions that require documentation improvements are here:

  • https://github.com/kowainik/typerep-map/blob/master/src/Data/TypeRepMap/Internal.hs

The same should be done for TMap module:

  • https://github.com/kowainik/typerep-map/blob/master/src/Data/TMap.hs

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

  • https://github.com/kowainik/relude/pull/87

chshersh avatar Oct 04 '18 03:10 chshersh

I guess I can give this a shot.

0xd34df00d avatar Oct 01 '19 20:10 0xd34df00d

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:

chshersh avatar Oct 09 '19 07:10 chshersh

@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?

0xd34df00d avatar Oct 10 '19 04:10 0xd34df00d

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

chshersh avatar Oct 10 '19 05:10 chshersh

@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 😄

ChrisPenner avatar Oct 11 '20 01:10 ChrisPenner

@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:

  • http://hackage.haskell.org/package/relude-0.7.0.0/docs/Relude-Nub.html

chshersh avatar Oct 13 '20 22:10 chshersh