Match the maybe, calling just if there is a value and nothing if not, and return the following value
function match({ just, nothing }) {
    return function (maybe) {
        for (const value of maybe) {
            return just(value);
        }
        return nothing();
    };
}