toyboot4e / ac-library-hs

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

Different / extra API to the original `ac-library` #30

Closed toyboot4e closed 1 week ago

toyboot4e commented 2 weeks ago

While I'd like to follow ac-libary API, some have to be different.

  1. Overloaded functions segtree has two different constructors for example. The latter is called build in ac-library-hs.

    explicit segtree(int n) : segtree(std::vector<S>(n, e())) {}
    explicit segtree(const std::vector<S>& v) : _n(int(v.size())) {

    maxflow and mincostflow have two different flow functions. Ones without flow limits are not in ac-library-hs (put maxBound manually).

  2. Segment tree / Lazy segment tree While C++ can pass functions as type parameters, Haskell cannot. Use some type class.

  3. Any more? In addition to get and set (or read and write in vector), modify and exchange can be added.

toyboot4e commented 2 weeks ago

Current arguable namings:

toyboot4e commented 2 weeks ago

I didn’t intent to add extra modules, but if I do, I would add..

but maybe too much. Monoids can be added for simplicity, though.