Thiago Arrais a4170b5e32 Transform for F# Pipeline (#9984)
* Transform for F#-style await

Inludes support for optimizing single-parameter arrow functions

* Wait until optimization before pushing placeholder into scope
2019-06-30 12:53:22 +02:00

28 lines
448 B
JavaScript

const y = 2;
const f = (x) => (x |> (y) => y + 1)
|> (z) => z * y
const _f = (x) => x
|> (y) => y + 1
|> (z) => z * y
const g = (x) => x
|> (y) => (y + 1 |> (z) => z * y)
const _g = (x) => x
|> (y => (y + 1 |> (z) => z * y))
const __g = (x) => x
|> (
y => {
return (y + 1 |> (z) => z * y);
}
)
expect( f(1)).toBe(4);
expect( _f(1)).toBe(4);
expect( g(1)).toBe(2);
expect( _g(1)).toBe(2);
expect(__g(1)).toBe(2);