mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 07:17:25 +03:00
26 lines
402 B
Markdown
26 lines
402 B
Markdown
|
|
Tests for a loop that was previously occurring in the type checker.
|
|
|
|
```ucm:hide
|
|
.> builtins.merge
|
|
```
|
|
|
|
```unison:error
|
|
structural ability A t g where
|
|
fork : '{g, A t g} a -> t a
|
|
await : t a -> a
|
|
empty! : t a
|
|
put : a -> t a -> ()
|
|
|
|
example : '{A t {}} Nat
|
|
example = 'let
|
|
r = A.empty!
|
|
go u =
|
|
t = A.fork '(go (u + 1))
|
|
A.await t
|
|
|
|
go 0
|
|
t2 = A.fork '(A.put 10 r)
|
|
A.await r
|
|
```
|