-
-
Notifications
You must be signed in to change notification settings - Fork 1
function_syntax
J Pratt edited this page Jan 14, 2023
·
1 revision
float square(float x) { return x * x; }
float (*) float;
auto square = [](float x) { return x * x; }
std::function<float(float)>
fn square (x: float) -> float { x * x }
let square = |x: float| -> float x * x
fn (x: float) -> float
square x = x * x
(\x -> x * x)
Float -> Float
square(x) = x * x
(_(x) = x * x)
foo(kwarg(x) = x * x)
// Type for kwarg
foo(kwarg(x:Float):Float)
// Type for function
square(x:Float):Float