23 lines
436 B
Idris
23 lines
436 B
Idris
|
module Quox.OPE.Basics
|
||
|
|
||
|
%default total
|
||
|
|
||
|
public export
|
||
|
Scope : Type -> Type
|
||
|
Scope = SnocList
|
||
|
|
||
|
public export
|
||
|
Scoped : Type -> Type
|
||
|
Scoped a = Scope a -> Type
|
||
|
|
||
|
public export
|
||
|
data All : (a -> Type) -> Scoped a where
|
||
|
Lin : All p [<]
|
||
|
(:<) : All p xs -> p x -> All p (xs :< x)
|
||
|
%name OPE.Basics.All ps, qs
|
||
|
|
||
|
public export
|
||
|
mapAll : (forall x. p x -> q x) -> All p xs -> All q xs
|
||
|
mapAll f [<] = [<]
|
||
|
mapAll f (x :< y) = mapAll f x :< f y
|