Skip to content

Instantly share code, notes, and snippets.

@aerosol
Forked from sanmiguel/gen_ale_drinker.erl
Last active December 18, 2015 19:09
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 aerosol/5831213 to your computer and use it in GitHub Desktop.
Save aerosol/5831213 to your computer and use it in GitHub Desktop.
-module(gen_ale_drinker).
%% There are 2 types of drink:
-type style() :: ale | not_ale.
%% Need to support imperial measurements (not US pints though)
-type volume() :: {imperial_pint, non_neg_integer()} | {litre, non_neg_integer()}.
-type beverage() :: {style(), volume()}.
-callback drink(beverage()) -> ok | {error, ebeeroverflow}. %% This should never happen
-callback micturate() -> ok | {error, eontherug}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment