Advertisement
pcorrect

Untitled

May 14th, 2021
2,360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.26 KB | None | 0 0
  1. -module(foo).
  2. -export([bar/1]).
  3.  
  4. bar(X) ->
  5.   case correct(X) of
  6.     42 -> f(X)
  7.   end.
  8.  
  9. correct(X) ->
  10.   case f(X) of
  11.     1 -> 42;
  12.     Y when Y > 5 -> 42;
  13.     _ -> 0
  14.   end.
  15.  
  16. f(X) ->
  17.   case X of
  18.     6 -> 1;
  19.     1 -> 7;
  20.     3 -> 5;
  21.     _ -> 23
  22.   end.
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement