Skip to content

Instantly share code, notes, and snippets.

@johnfoconnor
Forked from anonymous/my_behaviour.erl
Last active August 29, 2015 14:13
Show Gist options
  • Save johnfoconnor/6503f2e617fc65b48934 to your computer and use it in GitHub Desktop.
Save johnfoconnor/6503f2e617fc65b48934 to your computer and use it in GitHub Desktop.
-module(my_behaviour)
-export_type([my_data_type/1]).
-type my_data_type(Type) :: {ok, Type} | {error, atom()}.
-callback my_custom_function() -> my_data_type(term()).
-module(my_impl)
-behaviour(my_behaviour)
-record(my_record, {}).
-spec my_custom_function() -> my_behaviour:my_data_type(#my_record{}).
my_custom_function() ->
#my_record{}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment