toyboot4e / ac-library-hs

[WIP] Haskell port of ac-library.
Creative Commons Zero v1.0 Universal
4 stars 0 forks source link

Prefer to use `HasCallStack`, even if it makes the library slower #13

Closed toyboot4e closed 1 month ago

toyboot4e commented 1 month ago

Because Haskell does not have native stack trace system (yet), I prefer to explicitly use HasCallStack. Or else users (if any) would struggle in nightmare on errors!

For vectors, be sure to use VGM.read / VGM.write, not VUM.read / VUM.write. Non-generic versions didn't getHasCallStack (for build time and performance assumption), and they weren't looked back.

For unzip, use boxed versions, which are $O(1)$.

HasCallStack can make the library slower, but I believe the call stack on error is much more important. Needless HasCallStack constraints should be removed though.