Created
May 19, 2020 16:28
-
-
Save SethHorsley/eb67fbe29288c63941c8c163033b4e12 to your computer and use it in GitHub Desktop.
Elixir Types
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 Year do | |
@typedoc """ | |
A 4 digit year, e.g. 1984 | |
""" | |
@type cType :: {integer, String.t} | |
@type year :: integer | |
@spec current_age(year) :: cType | |
def current_age(year_of_birth), do: {1, "sss"} | |
end | |
IO.inspect Year.current_age(2020) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment