Created
June 21, 2018 22:29
-
-
Save puffnfresh/ffef774756394c017fdbd5e2c8ec26d6 to your computer and use it in GitHub Desktop.
Reverse function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open import Data.List | |
open import Data.List.Properties | |
open import Relation.Binary.PropositionalEquality | |
record ReverseFunction : Set₁ where | |
field | |
f : ∀ {A} → List A → List A | |
rev : ∀ {A} (xs ys : List A) → f (xs ++ ys) ≡ f ys ++ f xs | |
sing : ∀ {A} (x : A) → f (x ∷ []) ≡ x ∷ [] | |
reverseF : ReverseFunction | |
reverseF = record | |
{ f = reverse | |
; rev = reverse-++-commute | |
; sing = λ x → refl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment