Skip to content

Instantly share code, notes, and snippets.

@jamesc
Created June 29, 2012 22:15
Show Gist options
  • Save jamesc/3021004 to your computer and use it in GitHub Desktop.
Save jamesc/3021004 to your computer and use it in GitHub Desktop.
not_found_cookbooks(AllVersions, Cookbooks) ->
case lists:filter(fun(CB) -> cookbook_exists(CB, AllVersions) end, Cookbooks) of
[] -> ok;
NotFound -> {not_found, [ cookbook_name(NFCookbook) || NFCookbook <- NotFound] }
end.
Can become :
not_found_cookbooks(AllVersions, Cookbooks) ->
NotFound = [ cookbook_name(Cookbook) || Cookbook <- Cookbooks, cookbook_exists(Cookbook, AllVersions)],
case NotFound
[] -> ok;
NotFound -> {not_found, NotFound}
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment