Skip to content

Instantly share code, notes, and snippets.

@jfdm
Created January 23, 2019 12:24
Show Gist options
  • Save jfdm/ef491908a3ae2865290f9b45899db517 to your computer and use it in GitHub Desktop.
Save jfdm/ef491908a3ae2865290f9b45899db517 to your computer and use it in GitHub Desktop.
An example of Thinnings for a very specific use case.
data CanSkip = MustKeep | CanSkip
data ThinnedList : (a : Type)
-> (contract : List (Pair a CanSkip))
-> Type
where
Empty : ThinnedList a Nil
Add : (x : a)
-> (rest : ThinnedList a xs) -> ThinnedList a ((x,b )::xs)
Skip : (rest : ThinnedList a xs) -> ThinnedList a ((x,CanSkip)::xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment