In chapter 5th of Thinking Functionally with Haskell by Richard Bird, there's an equation:
filter (all p) . cp = cp . map (filter p)
I wonder how to prove it? (fusion law)?
I try to prove with fusion law. but how to prove the fusion law?
In chapter 5th of Thinking Functionally with Haskell by Richard Bird, there's an equation:
filter (all p) . cp = cp . map (filter p)
I wonder how to prove it? (fusion law)?
I try to prove with fusion law. but how to prove the fusion law?
Copyright © 2021 Jogjafile Inc.
rewrite cp with foldr
Assumption: (a) filter (all p) (cp xss) = cp (map (filter p) xs) = folder g [[]] (map (filter p) xs)
should prove equation (b) holds
{# based on assumption (a)#) g (filter p xs) (filter (all p) (cp xss))