Skip to content

Instantly share code, notes, and snippets.

@guilleiguaran
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilleiguaran/4045a5994ff661364bba to your computer and use it in GitHub Desktop.
Save guilleiguaran/4045a5994ff661364bba to your computer and use it in GitHub Desktop.
@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

"Haskell-y" alternative

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

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