Skip to content

Instantly share code, notes, and snippets.

@FireyFly
Created February 3, 2014 10:11
Show Gist options
  • Save FireyFly/8781360 to your computer and use it in GitHub Desktop.
Save FireyFly/8781360 to your computer and use it in GitHub Desktop.
{-
f . g x . h $ y f . g x . h y
($) (.)
/ \ / \
/ \ / \
(.) y f (.)
/ \ .´ `.
/ \ .´ `.
f (.) (appl) (appl)
/ \ / \ / \
/ \ / \ / \
(appl) h g x h y
/ \
/ \
g x
-}
Definitions:
f (appl) x = f x -- function application, highest precedence, left-associative
f $ x = f x -- function application, lowest precedence, right-associative
(f . g) x = f (g x) -- function composition, middle precedence, left-associative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment