2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2021-09-03 02:55:27 +03:00
|
|
|
use builtin Scope
|
2023-09-20 19:06:58 +03:00
|
|
|
unique ability Async t g where async : {g} Nat
|
2021-09-03 02:55:27 +03:00
|
|
|
unique ability Exception where raise : Nat -> x
|
|
|
|
|
|
|
|
pure.run : a -> (forall t . '{Async t g} a) ->{Exception, g} a
|
|
|
|
pure.run a0 a =
|
|
|
|
a' : forall s . '{Scope s, Exception, g} a
|
|
|
|
a' = 'a0 -- typechecks
|
|
|
|
-- make sure this builtin can still be referenced
|
|
|
|
Scope.run a'
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2021-09-03 02:55:27 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2021-09-03 02:55:27 +03:00
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
|
|
do an `add` or `update`, here's how your codebase would
|
|
|
|
change:
|
|
|
|
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
|
2024-01-04 11:42:12 +03:00
|
|
|
ability Async t g
|
|
|
|
ability Exception
|
2021-09-03 02:55:27 +03:00
|
|
|
pure.run : a -> (∀ t. '{Async t g} a) ->{g, Exception} a
|
|
|
|
|
|
|
|
```
|