But most importantly, we can pass one argument to /
and get back a function:
let div42 = (/) 42
which is Int -> Int
.
div42 7
prints 6.0
.
The flip
function is (A -> (B -> C)) -> (B -> (A -> C))
.
let (\\) = flip (/)
is Int -> Int -> Int
but with its arguments
flipped.
(\\) 7 42
prints 6.0
and 7 \\ 42
prints 6.0
.
let vid7 = (\\) 7 in vid7 42
prints 6.0
.