Skip to content

Instantly share code, notes, and snippets.

@jez jez/dollar.sml
Created May 18, 2015

Embed
What would you like to do?
Haskell's $ operator in SML
infixr 0 $
fun f $ x = f x
fun compute NONE = "No value"
| compute (SOME x) = "The value is " ^ Int.toString x
fun println str = print $ str ^ "\n"
val _ = println $ compute $ SOME 42
val _ = println $ compute NONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.