Skip to content

Instantly share code, notes, and snippets.

@guilleiguaran
Last active Aug 29, 2015
Embed
What would you like to do?
@annotate inc(Int) :: Int
def inc(num), do: num + 1
@annotate id(A) :: A
def id(x), do: x
@annotate map([A], (A -> B)) :: [B]
def map(x, f), do: Enum.map(x, f)
@annotate abs(Number) :: Number
def abs(number), do: :erlang.abs(number)
@guilleiguaran
Copy link
Author

guilleiguaran commented Jul 30, 2015

"Haskell-y" alternative

@annotate map :: ([A], (A -> B)) -> [B]

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment