Skip to content

Instantly share code, notes, and snippets.

@alinpopa
Created August 1, 2012 05:00
Show Gist options
  • Save alinpopa/3223840 to your computer and use it in GitHub Desktop.
Save alinpopa/3223840 to your computer and use it in GitHub Desktop.
validate2.erl
validate_elements(ListOfLists) ->
lists:reverse(lists:foldl(fun(ValidationResult, Acc) ->
case ValidationResult of
ok -> Acc;
Else -> [Else | Acc]
end
end, [], lists:map(fun(Element) -> apply_validators(Element) end, ListOfLists))).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment