Last active
December 20, 2015 05:59
-
-
Save yfyf/6082749 to your computer and use it in GitHub Desktop.
Type unification error
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
module Issue | |
data Env : (t: Type) -> (iR: t -> Type) -> (xs: Vect t n) -> Type where | |
Empty : {iR: t -> Type} -> (Env t iR Vect.Nil) | |
Extend : {r:t} -> {iR: t -> Type} -> {xs: Vect t n} -> | |
(res: (iR r)) -> (Env t iR xs) -> (Env t iR (r::xs)) | |
data ElemAtIs : (i: Fin n) -> a -> Vect a n -> Type where | |
ElemAtIsHere : {x: a} -> {xs : Vect a n} -> ElemAtIs fO x (x::xs) | |
ElemAtIsThere : {i : Fin n} -> {x: a} -> {xs : Vect a n} -> | |
ElemAtIs i x xs -> ElemAtIs (fS i) x (y::xs) | |
data ResState = RState Nat Type | |
data Resource : ResState -> Type where | |
resource : (l: Nat) -> (r:ty) -> (Resource (RState l ty)) | |
REnv : (xs:Vect ResState n) -> Type | |
REnv xs = Env ResState Resource xs | |
envRead : {rsin: Vect ResState n} -> (REnv rsin) -> | |
(ElemAtIs i (RState (S k) ty) rsin) -> ty | |
envRead (Extend (resource l val) rsin) ElemAtIsHere = val | |
envRead (Extend r rsin) (ElemAtIsThere foo) = envRead rsin foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Failure: