Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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