Define Closure and Environment

This commit is contained in:
Kiana Sheibani 2023-03-06 12:32:34 -05:00
parent 898087509b
commit af4539e344
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -10,3 +10,19 @@ import Data.Profunctor.Strong
public export public export
interface Profunctor p => Closed p where interface Profunctor p => Closed p where
closed : p a b -> p (x -> a) (x -> b) closed : p a b -> p (x -> a) (x -> b)
-- Closure
public export
record Closure p a b where
constructor MkClosure
getClosure : forall x. p (x -> a) (x -> b)
-- Environment
public export
data Environment : (p : Type -> Type -> Type) -> Type -> Type -> Type where
MkEnv : ((z -> y) -> b) -> p x y -> (a -> z -> x) -> Environment p a b