quox/lib/Quox/OPE/Basics.idr

23 lines
436 B
Idris
Raw Normal View History

2022-11-06 06:39:33 -05:00
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