2022-02-16 11:39:21 +03:00
|
|
|
Some random ability stuff to ensure things work.
|
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2022-02-16 11:39:21 +03:00
|
|
|
unique ability A where
|
|
|
|
one : Nat ->{A} Nat
|
|
|
|
two : Nat -> Nat ->{A} Nat
|
|
|
|
three : Nat -> Nat -> Nat ->{A} Nat
|
|
|
|
four : Nat ->{A} (Nat -> Nat -> Nat -> Nat)
|
|
|
|
|
|
|
|
ha : Request {A} r -> r
|
|
|
|
ha = cases
|
|
|
|
{ x } -> x
|
|
|
|
{ one i -> c } -> handle c (i+1) with ha
|
|
|
|
{ two i j -> c } -> handle c (i+j) with ha
|
|
|
|
{ three i j k -> c } -> handle c (i+j+k) with ha
|
|
|
|
{ four i -> c } -> handle c (j k l -> i+j+k+l) with ha
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2022-02-16 11:39:21 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2022-02-16 11:39:21 +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 A
|
2022-02-16 11:39:21 +03:00
|
|
|
ha : Request {A} r -> r
|
|
|
|
|
|
|
|
```
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2022-02-16 11:39:21 +03:00
|
|
|
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
|
2024-01-04 11:42:12 +03:00
|
|
|
ability A
|
2022-02-16 11:39:21 +03:00
|
|
|
ha : Request {A} r -> r
|
|
|
|
|
|
|
|
```
|