Skip to content

Partial Application Discussion #12

@weswigham

Description

@weswigham

Let's talk about syntax for partial application of functions. Blame Steve. I disagree with Steve entirely, and believe it should be square brackets - and that the operation should potentially be over-loadable on a per-function basis via a meta-function.

thingy(x,y,z)
#Can be (fully) partially applied as
thingy[x][y][z]

This makes it very clear when you partially apply a tuple argument without the need for further grouping symbols.

thingy2((x,y),z)
#Can be (fully) partially applied as
thingy2[x,y][z]

I think this is sensible - especially if tuples are implicit during declaration or return without grouping symbols, for example:

T -> J -> (T, J)
fn thingy(x, y)
    x, y

fn letter
    let | x = 23, 24
    thingy2[x](25)

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