- Author: Richard Wei
- Date: October 2018
This document is written for both the machine learning community and the Swift programming language design community, with a strong focus on language design.
This document is written for both the machine learning community and the Swift programming language design community, with a strong focus on language design.
Inspired from https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch5.html | |
// Curries by partially applying 1 out of 2 arguments | |
func curry<A, B, C>(fn: (A, B) -> C, _ val: A) -> (B -> C) { | |
return { b in | |
fn(val, b) | |
} | |
} | |
// "compose" operator |