cons :: c → d → d f :: a → a → a false :: b filter :: (c → b) → d → d filter2 :: b → (c → b) → c → d → d g :: a → a h :: a → a map :: (c → c) → d → d nil :: d true :: b g(h(g(X))) → g(X) g(g(Y)) → g(h(g(Y))) h(h(U)) → h(f(h(U), U)) map(H, nil) → nil map(I, cons(P, X1)) → cons(I(P), map(I, X1)) filter(Z1, nil) → nil filter(G1, cons(V1, W1)) → filter2(G1(V1), G1, V1, W1) filter2(true, J1, X2, Y2) → cons(X2, filter(J1, Y2)) filter2(false, G2, V2, W2) → filter(G2, W2)