def from_maybe(default, maybe_val):
    """Takes a maybe_value and a default,
    if the maybe_value is nothing returns the default,
    else returns the value."""
    try:
        return maybe_val.value
    except ValueError:
        return default