module sum-type where
infix 45 _+_ data _+_ (A B : Set) : Set where inl : A → A + B inr : B → A + B
private variable A B C : Set case-+ : A + B → (A → C) → (B → C) → C case-+ (inl a) f g = f a case-+ (inr b) f g = g b