You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
||| A singleton type, constrained to be a single value
5
+
|||
6
+
||| The underlying value and the proof are both erased at runtime, as they can
7
+
||| be converted back to the index by reconstructing the value as required.
8
+
|||
9
+
||| Inspired by the singleton type [found in Adga’s documentation](https://agda.readthedocs.io/en/v2.5.4.1/language/with-abstraction.html#the-inspect-idiom).
10
+
public export
11
+
record Sing {0A:Type} (x : A) where
12
+
constructor MkSing
13
+
||| The underlying value of the singleton (erased at run-time)
14
+
0val: A
15
+
||| A proof that @val is the same as the indexed value (erased at run-time)
16
+
{auto 0prf: x = val}
17
+
18
+
19
+
||| Convert a singleton back to its underlying value restoring it with a value
0 commit comments