Skip to content

let type aliases declared inside a function be available for parameters and the result type #8704

Closed
@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd

consider

// currently have to deal with
export function glueAllHomoDiffs<a>(diffs: edf.HomoDifference<NativeSet<a>>[]): edf.HomoDifference<NativeSet<a>> {
    return ea.fold(
        diffs,
        edf.toHomoNoneOf<NativeSet<a>>(),
        (result, diff) => edf.glueHomoDifference(result, diff, glue, shallowCopy)
    );
}


// wish could do
export function glueAllHomoDiffs<a>(diffs: Difference[]): Difference {

    type Selection = NativeSet<a>;
    type Difference = edf.HomoDifference<Selection>;

    return ea.fold(
        diffs,
        edf.toHomoNoneOf<Selection>(),
        (result, diff) => edf.glueHomoDifference(result, diff, glue, shallowCopy)
    );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions