SHARE
TWEET

Untitled

a guest Apr 25th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. is_list_elem_is_42(List) ->
  2.     F = fun(Element, AccIn) ->
  3.         case Element of
  4.             42 -> lists:append(AccIn, [true]);
  5.             _ -> lists:append(AccIn, [false])
  6.         end
  7.     end,
  8.     lists:foldl(F,[],List).
  9.     %[1, q, "Hello", 'World', 42, {1,488}]
  10.     %[false, false, false, false, true, false]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top