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 | Functor (Ext c) where
24 | map {c=shp !> pos} f (s <| v) = s <| f . v
28 | Functor (Ext d . Ext c) where
29 | map f e = (map f) <$> e
36 | extMap : c =%> d -> Ext c a -> Ext d a
37 | extMap f (sh <| index) = let (
y ** ky)
= (%!) f sh
38 | in y <| (index . ky)
42 | (.ext) : c =%> d -> Ext c a -> Ext d a
49 | mapShapeExt : {0 c : Cont} ->
51 | (l : c `fullOf` a) ->
52 | shapeExt (f <$> l) = shapeExt l
53 | mapShapeExt {c=shp !> pos} (sh <| _) = Refl
58 | mapIndexCont : {c : Cont} ->
60 | (l : c `fullOf` a) ->
61 | (ps : c.Pos (shapeExt (f <$> l))) ->
62 | f (index l (rewrite sym (mapShapeExt {f=f} l) in ps))
63 | = index (f <$> l) ps
64 | mapIndexCont {c=shp !> pos} (sh <| contentAt) ps = Refl
73 | record EqExt (e1, e2 : Ext c a) where
76 | shapesEqual : e1.shapeExt = e2.shapeExt
79 | valuesEqual : (p : c.Pos (e1.shapeExt)) ->
81 | e2.index (rewrite__impl (c.Pos) (sym shapesEqual) p)
86 | decEqExt : (e1, e2 : Ext c a) ->