unison/unison-src/transcripts/unsafe-coerce.output.md

54 lines
936 B
Markdown
Raw Permalink Normal View History

``` unison
2021-08-20 21:50:05 +03:00
f : '{} Nat
f _ = 5
fc : '{IO, Exception} Nat
fc = unsafe.coerceAbilities f
main : '{IO, Exception} [Result]
main _ =
n = !fc
if n == 5 then [Ok ""] else [Fail ""]
```
``` ucm
2021-08-20 21:50:05 +03:00
Loading changes detected in scratch.u.
2021-08-20 21:50:05 +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`:
f : 'Nat
fc : '{IO, Exception} Nat
main : '{IO, Exception} [Result]
```
``` ucm
scratch/main> find unsafe.coerceAbilities
2021-08-20 21:50:05 +03:00
2023-08-18 00:55:28 +03:00
1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b
2021-08-20 21:50:05 +03:00
scratch/main> add
2021-08-20 21:50:05 +03:00
⍟ I've added these definitions:
f : 'Nat
fc : '{IO, Exception} Nat
main : '{IO, Exception} [Result]
scratch/main> io.test main
2021-08-20 21:50:05 +03:00
New test results:
1. main ◉
2021-08-20 21:50:05 +03:00
✅ 1 test(s) passing
2024-06-26 23:01:36 +03:00
Tip: Use view 1 to view the source of a test.
2021-08-20 21:50:05 +03:00
```