Skip to content

Commit

Permalink
Maybe: elim. (#751)
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas Nuyts <[email protected]>
  • Loading branch information
anuyts and Andreas Nuyts authored Apr 3, 2022
1 parent ab79d25 commit eee5c9c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Cubical/Data/Maybe/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ open import Cubical.Core.Everything

private
variable
: Level
A B : Type ℓ
ℓ ℓA ℓB : Level
A : Type ℓA
B : Type ℓB

data Maybe (A : Type ℓ) : Type ℓ where
nothing : Maybe A
Expand All @@ -23,3 +24,7 @@ map-Maybe f (just x) = just (f x)
rec : B (A B) Maybe A B
rec n j nothing = n
rec n j (just a) = j a

elim : {A : Type ℓA} (B : Maybe A Type ℓB) B nothing ((x : A) B (just x)) (mx : Maybe A) B mx
elim B n j nothing = n
elim B n j (just a) = j a

0 comments on commit eee5c9c

Please sign in to comment.