0 | module Data.Container.Base.Extension.Definition
2 | import Data.Container.Base.Object.Definition
3 | import Data.Container.Base.Morphism.Definition
10 | record Ext (0 c : Cont) (x : Type) where
13 | index : c.Pos shapeExt -> x
18 | fullOf : Cont -> Type -> Type
19 | fullOf c x = Ext c x
23 | Path c = (x : c.Shp ** c.Pos x)
27 | Functor (Ext c) where
28 | map {c=shp !> pos} f (s <| v) = s <| f . v
32 | Functor (Ext d . Ext c) where
33 | map f e = (map f) <$> e
40 | extMap : c =%> d -> Ext c a -> Ext d a
41 | extMap f (sh <| index) = let (
y ** ky)
= (%!) f sh
42 | in y <| (index . ky)
48 | mapShapeExt : {0 c : Cont} ->
50 | (l : c `fullOf` a) ->
51 | shapeExt (f <$> l) = shapeExt l
52 | mapShapeExt {c=shp !> pos} (sh <| _) = Refl
57 | mapIndexCont : {c : Cont} ->
59 | (l : c `fullOf` a) ->
60 | (ps : c.Pos (shapeExt (f <$> l))) ->
61 | f (index l (rewrite sym (mapShapeExt {f=f} l) in ps))
62 | = index (f <$> l) ps
63 | mapIndexCont {c=shp !> pos} (sh <| contentAt) ps = Refl
72 | record EqExt (e1, e2 : Ext c a) where
75 | shapesEqual : e1.shapeExt = e2.shapeExt
78 | valuesEqual : (p : c.Pos (e1.shapeExt)) ->
80 | e2.index (rewrite__impl (c.Pos) (sym shapesEqual) p)
85 | decEqExt : (e1, e2 : Ext c a) ->