def from_maybe(default, maybe):
    """
    Helper for translating code using Haskell's:

        fromMaybe default maybe

    (typically, the argument order feels back-to-front for python code
    but it's easier to translate code if we keep it the same)
    """
    return maybe if maybe is not None else default
