Skip to content

Instantly share code, notes, and snippets.

@dgfitch
Created April 28, 2010 17:39
Show Gist options
  • Save dgfitch/382427 to your computer and use it in GitHub Desktop.
Save dgfitch/382427 to your computer and use it in GitHub Desktop.
let f x = sprintf "[%A]" x
let g x = sprintf "{%A}" x
(* So you have two functions (string -> string)
Now, you want to do let result = f g "hi"
However, f doesn't take a function string -> string, it takes a string.
So you need to tell the compiler about your precedence.
Normal "idiomatic" ways: *)
f (g "input")
"input" |> g |> f
(* Crazier ways: *)
f <| g "input"
(f >> g) "input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment