2 | import Data.Coproduct
8 | distributePlus : a * (b + c) -> a * b + a * c
9 | distributePlus (fst && (+> x)) = +> (fst && x)
10 | distributePlus (fst && (<+ x)) = <+ (fst && x)
14 | distributive : (p * p') * (s + s') -> (p * s) + (p' * s')
15 | distributive ((fst && snd) && (<+ x)) = <+ (fst && x)
16 | distributive ((fst && snd) && (+> x)) = +> (snd && x)
20 | distributive' : (p + q) * (a * b) -> (p * a) + (q * b)
21 | distributive' ((<+ x) && a && b) = <+ (x && a)
22 | distributive' ((+> x) && a && b) = +> (x && b)
25 | multiply : a + a -> Bool * a
26 | multiply = choice (True &&) (False &&)