Created
April 2, 2015 13:58
-
-
Save david-christiansen/195080f0cecb295699ca to your computer and use it in GitHub Desktop.
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
module Snoc | |
data SnocList : List a -> Type where | |
SnocNil : SnocList [] | |
Snoc : (xs : List a) -> (x : a) -> SnocList (xs ++ [x]) | |
snocList : (xs : List a) -> SnocList xs | |
snocList [] = SnocNil | |
snocList (x :: xs) with (snocList xs) | |
snocList (x :: []) | SnocNil = Snoc [] x | |
snocList (x :: (ys ++ [y])) | (Snoc ys y) = Snoc (x::ys) y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment