Copyright | (c) Kimiyuki Onaka 2020 |
---|---|
License | Apache License 2.0 |
Maintainer | kimiyuki95@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- run :: MonadError Error m => Program -> m Program
Documentation
run :: MonadError Error m => Program -> m Program Source #
run
replaces superfluous copying.
Examples
Before:
vector<int> solve(vector<int> a) { vector<int> b = a; b[0] = 1; return b; }
After:
vector<int> solve(vector<int> a) { a[0] = 1; return a; }
Before:
int solve(int a, int b, int x) { jikka::convex_hull_trick cht = jikka::convex_hull_trick(); cht = jikka::convex_hull_trick::persistent_add_line(cht, a, b); return cht.get_min(x); }
After:
int solve(int a, int b, int x) { jikka::convex_hull_trick cht; cht = cht.add_line(a, b); return cht.get_min(x); }