Skip to content

Instantly share code, notes, and snippets.

@laMudri
Created November 6, 2022 11:59
Show Gist options
  • Save laMudri/9a23d29ab3a800f5d93e856dd34876b8 to your computer and use it in GitHub Desktop.
Save laMudri/9a23d29ab3a800f5d93e856dd34876b8 to your computer and use it in GitHub Desktop.
{-# OPTIONS --cubical #-}
module Scratch where
open import Cubical.Foundations.Everything
open import Cubical.Data.Equality
module _ {a} {A : Type a} where
data View {x : A} : {y : A} → x ≡ y → Type a where
vrefl : View refl
view : ∀ {x y} (p : x ≡ y) → View p
view = J (λ y p → View p) vrefl
-- Test:
test : ∀ {x y z : A} → x ≡ y → y ≡ z → x ≡ z
test p q with vrefl ← view p = q
test2 : isSet A → ∀ {x y : A} (p : x ≡ y) (q : y ≡ x) → test p q ≡ refl
test2 set p q with vrefl ← view p = set _ _ q refl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment