Skip to content

Feature request: Functional operators #84

@ConorOBrien-Foxx

Description

@ConorOBrien-Foxx

There should be an operator that curries a function. Perhaps ~:?

let add = ~: (x, y, z) -> x + y * z;
print(add(3)(4)(5));    // 23

A memoizing function/operator. E.g.:

let fib = memo(n -> n < 2 ? n : fib(n - 1) + fib(n - 2))
fib(1000); // takes however long
fib(1000); // takes virtually no time

Dynamic programing FTW!


I wonder if any more should be considered.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions