Guest User

Untitled

a guest
Aug 14th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.33 KB | None | 0 0
  1. case Foos of
  2.   _ when IsBar -> baz;
  3.   []           -> quux;
  4.   [Foo]        -> Foo
  5. end.
  6.  
  7. vs.
  8.  
  9. case {IsBar, Foos} of
  10.   {true ,     _} -> baz;
  11.   {false,    []} -> quux;
  12.   {false, [Foo]} -> Foo
  13. end.
  14.  
  15. vs.
  16.  
  17. case IsBar of
  18.   true  -> baz
  19.   false ->
  20.     case Foos of
  21.       []    -> quux;
  22.       [Foo] -> Foo
  23.     end
  24. end.
Add Comment
Please, Sign In to add comment