A) -> Either<A, B> { .left(a) } /// `B ===> A ∨ B` func orIntro2<A, B>(_ b: B) -> Either<A, B> { .right(b) } /// `A ∨ B, A → C, B → C ===> C` func orElim<A, B, C>( _ e: Either<A, B>, _ ac: (A) -> C, _ bc: (B) -> C ) -> C { switch e { case let .left(a): return ac(a) case let .right(b): return bc(b) } } A A ∨ B B A ∨ B A ∨ B C C C ⋮ [A] ⋮ [B]