Skip to content

Instantly share code, notes, and snippets.

@axhixh
Last active September 12, 2024 23:53
Show Gist options
  • Select an option

  • Save axhixh/0fa84facbd42beae349d23df8bc32d1a to your computer and use it in GitHub Desktop.

Select an option

Save axhixh/0fa84facbd42beae349d23df8bc32d1a to your computer and use it in GitHub Desktop.
Pipeline operator `|>` for standardml
infix |> fun x |> f = f x;
fun add x y = x + y;
3
|> add 5
|> add 2
;
[1, 2, 3]
|> List.map (fn x => x + 1)
|> List.filter (fn x => x mod 2 = 0)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment