October 08, 2018

fast piping in reasonml

fast piping in reasonml
fast piping allow you to transform your function code into more readable syntax, imaging you have human(person(age())) this is very inconvenience to see. with piping you can do it like this:


which is exactly the same as human(person(age()))

there are 3 different pipes as I understand you can do like

|> person
|> human


human @@ age->person

whats different is that |> will put the parameter on the right side and


on the left side


this will take person function and use on the first parameter so it become human(person, "something");
however if you are using person

|> human("something");

it become human("something", person);
and @@ is like wrap into ()

human @@ age->person

is same as


which will equals to


you can read more here