bool/show
Convert a boolean to its string representation via the Show typeclass
const app = mvfm(prelude);
const prog = app({ x: "number" }, ($) => {
// Wrap in $.not($.not(...)) to produce a boolean-typed node for show dispatch
const isPositive = $.not($.not($.gt($.input.x, 0)));
// $.show dispatches to bool/show for boolean expressions
return $.concat("positive: ", $.show(isPositive));
});
await fold(defaults(app), injectInput(prog, { x: 5 })); Ctrl+Enter