Listsis support for nondeterministic computations.
Maybecomputations can return either
Listcomputations can return zero, one or multiple values based on their length. Let's see how this is defined in the
returnmethod simply takes a value
xand puts it into a
(>>=)method for lists extracts all the values
xfrom the list
mand applies the function
fto each of them, combining all the results in one final list. As with the
Maybemonad, the bind operator, allows us to chain operations together with lists as well. With lists, these chaining operations will combine all output possibilities in a single result list.
mitosisfunction is applied to each element of the list, providing a resulting list to be passed to the subsequent functions.