Vocabulary monadics Inputs x an object pairs Array of pairs of form: { error-value [ predicate? ] }
Outputs Word description Applies each predicate to
x in turn. If the result of any is
f ,
x is replaced with
Left error-value according to the predicate which it failed, otherwise, raises
x to a
Right value.
Examples USING: kernel math monadics sequences sets prettyprint ;
: trivial-validate-username ( string -- Either-string )
{ { "Name is too long."
[ length 32 < ] }
{ "Forbidden Characters."
[ "(){}<>\"" intersect { } = ] }
} validate ;
"EvilUsername\"" trivial-validate-username . T{ Left { value "Forbidden Characters." } }
Definition
This documentation was generated offline from a
load-all image. If you want, you can also
browse the documentation from within the UI developer tools . See
the Factor website
for more information.
Factor 0.101 x86.64 (2296, heads/master-100904b2de, Dec 2 2025 20:02:46)