Slide 8
Slide 8 text
ド・モルガンの法則の一部は、こんなふうに書けます。
import Data.Void
and_l :: (p, q) -> p
and_l (hp, _) = hp
and_r :: (p, q) -> q
and_r (_, hq) = hq
deMorgan :: (Either (p -> Void) (q -> Void)) -> ((p, q) -> Void)
deMorgan (Left hnp) = hnp . and_l
deMorgan (Right hnq) = hnq . and_r
¬P ∨ ¬Q → ¬(P ∧ Q)
8