Last active
September 23, 2015 21:15
-
-
Save matteosister/4d1ba9224b304d3739f2 to your computer and use it in GitHub Desktop.
This file contains 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
defmodule InfixFC do | |
@doc """ | |
define an infix operator <|> to compose functions | |
""" | |
defmacro left <|> right do | |
quote bind_quoted: [left: left, right: right] do | |
fn (v) -> left.(right.(v)) end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment