[ libs ] add DecEq to Prelude
This commit is contained in:
@@ -126,6 +126,17 @@ cong f Refl = Refl
|
|||||||
sym : ∀ A. {0 a b : A} → a ≡ b → b ≡ a
|
sym : ∀ A. {0 a b : A} → a ≡ b → b ≡ a
|
||||||
sym Refl = Refl
|
sym Refl = Refl
|
||||||
|
|
||||||
|
data Void : U where
|
||||||
|
|
||||||
|
¬ : U → U
|
||||||
|
¬ x = x → Void
|
||||||
|
|
||||||
|
data Dec : U → U where
|
||||||
|
Yes : ∀ prop. (prf : prop) → Dec prop
|
||||||
|
No : ∀ prop. (contra : ¬ prop) → Dec prop
|
||||||
|
|
||||||
|
class DecEq t where
|
||||||
|
decEq : (x₁ : t) → (x₂ : t) → Dec (x₁ ≡ x₂)
|
||||||
|
|
||||||
|
|
||||||
-- Functor
|
-- Functor
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ module Neighbors
|
|||||||
-- Prf ?
|
-- Prf ?
|
||||||
import Prelude
|
import Prelude
|
||||||
|
|
||||||
data Void : U where
|
|
||||||
|
|
||||||
data Prf : U → U where
|
data Prf : U → U where
|
||||||
Pf : ∀ a. {{_ : a}} → Prf a
|
Pf : ∀ a. {{_ : a}} → Prf a
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,6 @@ module RunLength
|
|||||||
|
|
||||||
import Prelude
|
import Prelude
|
||||||
|
|
||||||
-- TODO this belongs in a library
|
|
||||||
|
|
||||||
data Void : U where
|
|
||||||
|
|
||||||
Not : U → U
|
|
||||||
Not x = x → Void
|
|
||||||
|
|
||||||
data Dec : U → U where
|
|
||||||
Yes : ∀ prop. (prf : prop) → Dec prop
|
|
||||||
No : ∀ prop. (contra : Not prop) → Dec prop
|
|
||||||
|
|
||||||
class DecEq t where
|
|
||||||
decEq : (x₁ : t) → (x₂ : t) → Dec (x₁ ≡ x₂)
|
|
||||||
|
|
||||||
-- end lib
|
|
||||||
|
|
||||||
rep : ∀ a. Nat → a → List a
|
rep : ∀ a. Nat → a → List a
|
||||||
rep Z x = Nil
|
rep Z x = Nil
|
||||||
rep (S k) x = x :: rep k x
|
rep (S k) x = x :: rep k x
|
||||||
|
|||||||
Reference in New Issue
Block a user