monadz playground

monadz

Monads for Go 1.27: chain steps that can be missing, fail, or run later. The library moves the value or the error from step to step.

Each tab below runs the real Go library in your browser, compiled to WebAssembly. Change an input and watch the result change.

A value in a box moves along a track The box moves along the top track through each step. At step 3 the step fails, the box drops to the bottom track, and steps 3 and 4 do not run. Ok Err step 1 step 2 step 3 step 4 42 err
The value sits in a box. Each step moves the box along the top track, or drops it to the bottom track. After the drop, the later steps do not run.
Loading the Go library… The page downloads monadz, compiled to WebAssembly (about 2 MB).