case Expression of
Pattern1 [when Guard1] -> Expr_seq1;
Pattern2 [when Guard2] -> Expr_seq2;
....
end
filter(P, [H|T]) -> filter1(P(H), H, P, T);
filter(P, []) -> [];
filter1(true, H, P, T) -> [H|filter(P, T)];
filter1(false, H, P, T) -> filter(P, T).
filter(P, [H|T]) ->
case P(H) of
true -> [H|filter(P, T)];
false -> filter(P, T)
end;
filter(P, []) -> [].
if
Guard1 -> Expr_seq1;
Guard2 -> Expr_seq2;
....
end