tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

19 lignes · 587 octetsBrut · Historique
1// `demonitor` takes the pid and the `Down` subject `monitor` returned
2// (issue #414); `monitor`'s type is unchanged.
3
4import std/process.{type Down, type Pid, type Subject, type proc}
5
6fn watch_then_forget :: pid: Pid -> Subject<Down> / <proc>
7{
8 let down = process.monitor pid
9 process.demonitor pid down
10 process.demonitor_flush pid down
11 down
12}
13//~ TYPE watch_then_forget: fn(Pid) -> Subject<Down> / <proc>
14
15fn another_subject :: pid: Pid replies: Subject<Int> -> () / <proc>
16{
17 process.demonitor pid replies
18 //~^ ERROR E0202 expected `Subject<Down>`, found `Subject<Int>`
19}