Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You would lose the performance optimisations of a copy, but you can still express tests in this tree fashion with global state. You just need to recurs the tree from the top down and run the entire path up to each node. A simple example:

  test_fork<A, B, C>(a: A, f: (A) -> B, gs: List<(B) -> C>) -> List<C> {
    fs.map(g -> g(f(a)))
  }
As you can see, the first step of the test is re-run from scratch every other branch of it.


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: