outcome
outcome
Type Parameters
Functions
group the elements of this sequence by a key of type K
f determines the key of an element
f determines the key of an element
0.095dev (2026-02-20 12:42:29 GIT hash dbcc3e4b3d2a59f66230b482cff8f0b018178d77 built by fridi@fzen)
outcome is a choice type that represents the result of a routine that
may either produce something useful or fail producing an error condition.
Several error conditions are needed if there are several very different
reasons for an operation to fail, e.g.
Note that 'outcome data IO_Error' is not assignment compatible with
'outcome data IO_Error Permission_Error', it has to be unwrapped first.
This unwrapping, however, requires very little boilerplate, it is done
using the '?' on the result of the call to 'read_file': This unwraps
'outcome data IO_Error' into 'IO_Error', which would be returned abruptly,
and 'data', which would be returned normally. Both are assignment
compatible to 'outcome data IO_Error Permission_Error', so everything
is fine.