Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 22nd, 2010  |  syntax: Erlang  |  size: 0.39 KB  |  views: 103  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. -module(test).
  2.  
  3. -export([start/0]).
  4.  
  5. -spec start() -> ok.
  6. start() ->
  7.    AtomBad = get_atom(1),
  8.    AtomGood = get_atom(2),
  9.    check_atom(AtomBad),
  10.    case check_atom(AtomGood) of
  11.        ok -> ok;
  12.        error -> error
  13.    end.
  14.  
  15. -spec get_atom(any()) -> good | bad.
  16. get_atom(1) ->
  17.    bad;
  18. get_atom(_) ->
  19.    good.
  20.  
  21. -spec check_atom(good | nice) -> ok | error.
  22. check_atom(Atom) ->
  23.    ok.
clone this paste RAW Paste Data