feat: Invalidation and lazy reloading of implementations

The interface is a bit clunky, the "author" and the callback "data"
  have to be specified when adding (an) implementation(s) in order
  for this to work. But it does, and this is just a PoC, the interface
  could be cleaned up.
This commit is contained in:
Glen Whitney 2022-03-25 13:09:50 -07:00
parent 00a7f79552
commit 1c1ba91e48
4 changed files with 70 additions and 18 deletions

View file

@ -4,6 +4,6 @@ export default function create(pmath) {
return pmath(
'subtract',
[args => args.length === 2, (x, y) => add(x, negate(y))],
create)
create, pmath)
return pmath.subtract
}