Skip to content

Instantly share code, notes, and snippets.

@nessamurmur
Created February 26, 2016 15:22
Show Gist options
  • Save nessamurmur/6d5ad3f32965b90b5d1a to your computer and use it in GitHub Desktop.
Save nessamurmur/6d5ad3f32965b90b5d1a to your computer and use it in GitHub Desktop.
defmodule Character do
import Algae.Maybe
@type t :: %__MODULE__{
name: Just.t | Nothing.t
}
defstruct name: maybe
@spec return_dan :: Character.t
def return_dan, do: %Character{name: "Dan"}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment