Skip to content

Instantly share code, notes, and snippets.

@PragTob
Created June 16, 2019 15:40
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 PragTob/c38269e5e1b9eb7b8f6c3bf46d0b9e0c to your computer and use it in GitHub Desktop.
Save PragTob/c38269e5e1b9eb7b8f6c3bf46d0b9e0c to your computer and use it in GitHub Desktop.
Board behaviour
defmodule Board do
# can't be more specific witht types as each implementation has its own representation
@type board :: any
@type field :: any
@callback new() :: board
@callback get(board, non_neg_integer, non_neg_integer) :: field
@callback set(board, non_neg_integer, non_neg_integer, field) :: board
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment