Last active
September 12, 2024 23:53
-
-
Save axhixh/0fa84facbd42beae349d23df8bc32d1a to your computer and use it in GitHub Desktop.
Pipeline operator `|>` for standardml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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