Elm Exactly

Figureeffects-apply

Figure 24, APPLY on Effect Values, in Section 8.6 The Effect Values of the Basis.

basic value bbarity(b)\arity(b)APPLY(b,v1⋯vn)\APPLY(b,v_1\cdots v_n)
Task.succeed1APPLY(b,v)={succeed v}\APPLY(b,v)=\{\effsucceed\,v\}
Task.fail1APPLY(b,v)={fail v}\APPLY(b,v)=\{\efffail\,v\}
Task.andThen2APPLY(b,v,tk)={andThen(v,tk)}\APPLY(b,v,\tk)=\{\effandThen(v,\tk)\}
Task.onError2APPLY(b,v,tk)={onError(v,tk)}\APPLY(b,v,\tk)=\{\effonError(v,\tk)\}
Task.command1APPLY(b,Perform tk)={leaf(task,tk)}\APPLY(b,\kw{Perform}\ \tk)=\{\effleaf(\effmtask,\tk)\}
Process.sleep1APPLY(b,v)={prim(sleep,v)}\APPLY(b,v)=\{\effprim(\effsleep,v)\}
Process.spawn1APPLY(b,tk)={prim(spawn,tk)}\APPLY(b,\tk)=\{\effprim(\effspawn,\tk)\}
Process.kill1APPLY(b,pid)={prim(kill,pid)}\APPLY(b,\pid)=\{\effprim(\effkill,\pid)\}
Cmd.batch1APPLY(b,[cm1,…,cmn])={batch(cm1⋯cmn)}\APPLY(b,[\cm_1,\ldots,\cm_n])=\{\effbatch(\cm_1\cdots\cm_n)\}
Cmd.map2APPLY(b,v,cm)={map(v,cm)}\APPLY(b,v,\cm)=\{\effmap(v,\cm)\}
Sub.batch1APPLY(b,[sb1,…,sbn])={batch(sb1⋯sbn)}\APPLY(b,[\sbv_1,\ldots,\sbv_n])=\{\effbatch(\sbv_1\cdots\sbv_n)\}
Sub.map2APPLY(b,v,sb)={map(v,sb)}\APPLY(b,v,\sbv)=\{\effmap(v,\sbv)\}
Platform.worker1APPLY(b,r)={prog r}\APPLY(b,r)=\{\effprog\,r\}
Figure 24: APPLY on Effect Values
Read it in its chapter·Permanent address: /standard/figures/effects-apply

Referred to from

Tests (0)

No test of the suite checks this figure yet.

Discussions

Discuss this figure·Search the discussions on GitHub

Discussions are on GitHub; one about this figure has [fig:effects-apply] in its title.

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.