def first_ok(results):
    """first ok or last err

    Examples
    --------
    >>> orz.first_ok([orz.Err('wrong value'), orz.Ok(42), orz.Ok(3)])
    Ok(42)

    >>> @orz.first_ok.wrap
    >>> def get_value_rz(key):
    ...     yield l1cache_rz(key)
    ...     yield l2cache_rz(key)
    ...     yield get_db_rz(key)

    Parameters
    ----------
    results : Iterator[Result]

    Returns
    -------
    Result
        first ok or last err in parameters
    """
    result = None
    for result in results:
        if result.is_ok():
            return result
    return result
