Skip to content

Lang: partial operator #402

@ospencer

Description

@ospencer

The partial operator allows you to partially apply a function.

For example, look at this implementation of an add function:

let add = (a, b) => a + b

In let add2 = partial add(2), add2 is a function that accepts a single argument and adds two to it.

Arguments may also be skipped and provided later:

let map123 = partial List.map(_, [1, 2, 3])

map123(a => a * 4) // [4, 8, 12]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions