Created
March 5, 2019 11:21
-
-
Save clayrat/71b72606dbd93922acd985d1ae083dbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import Data.NEList -- from idris-tparsec | |
| nelList : Iso (List a) (Maybe (NEList a)) | |
| nelList = MkIso fromList (maybe Nil NEList.toList) fromTo toFrom | |
| where | |
| fromTo : (y : Maybe (NEList a)) -> fromList (maybe [] NEList.toList y) = y | |
| fromTo Nothing = Refl | |
| fromTo (Just (MkNEList h t)) = Refl | |
| toFrom : (x : List a) -> maybe [] NEList.toList (fromList x) = x | |
| toFrom [] = Refl | |
| toFrom (x::xs) = Refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment