open import 1Lab.Path open import 1Lab.Type module 1Lab.Type.Dec where
Decidable typesπ
A type is decidable if itβs computable whether or not that type is inhabited.
data Dec {β} (A : Type β) : Type β where yes : A β Dec A no : (A β β₯) β Dec A case : β {β β'} {A : Type β} (P : Dec A β Type β') β ((y : A) β P (yes y)) β ((y : (A β β₯)) β P (no y)) β (x : Dec A) β P x case P f g (yes x) = f x case P f g (no x) = g x
A type is discrete if it has decidable equality.
Discrete : β {β} β Type β β Type β Discrete A = (x y : A) β Dec (x β‘ y)