def wrapAsUnion(expr, typeName):
    """Converts a bare expression to a tagged union with a given type name.

    :type expr: any
    :param expr: PFA value
    :type typeName: string
    :param typeName: name for the type tag
    :rtype: dict with one key-value pair
    :return: tagged PFA value
    """

    if expr is None:
        return expr
    else:
        return {typeName: expr}