typerep-map
typerep-map copied to clipboard
Write function O-notation in prettier way using latex
Haddock supports that.
Where exactly are the ocurrences of this?
@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
I guess I can give this a shot.
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 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 Hmm, indeed, I can see how this can be challenging. No worries then! :slightly_smiling_face:
@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 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