Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"
Add Comment
Please, Sign In to add comment