0 | module Data.Container.Base.Extension.Definition
2 | import Data.Container.Base.Object.Definition
9 | record Ext (0 c : Cont) (x : Type) where
12 | index : c.Pos shapeExt -> x
17 | fullOf : Cont -> Type -> Type
18 | fullOf c x = Ext c x
22 | Path c = (x : c.Shp ** c.Pos x)
26 | Functor (Ext c) where
27 | map {c=shp !> pos} f (s <| v) = s <| f . v
31 | Functor ((Ext d) . (Ext c)) where
32 | map f e = (map f) <$> e
37 | set : {0 c : Cont} -> InterfaceOnPositions c Eq =>
38 | (e : Ext c x) -> c.Pos (shapeExt e) -> x -> Ext c x
39 | set {c=(s !> p)} @{MkI} (sh <| contentAt) i x
40 | = sh <| updateAt contentAt (i, x)
45 | mapShapeExt : {0 c : Cont} ->
47 | (l : c `fullOf` a) ->
48 | shapeExt (f <$> l) = shapeExt l
49 | mapShapeExt {c=shp !> pos} (sh <| _) = Refl
54 | mapIndexCont : {c : Cont} ->
56 | (l : c `fullOf` a) ->
57 | (ps : c.Pos (shapeExt (f <$> l))) ->
58 | f (index l (rewrite sym (mapShapeExt {f=f} l) in ps))
59 | = index (f <$> l) ps
60 | mapIndexCont {c=shp !> pos} (sh <| contentAt) ps = Refl
69 | record EqExt (e1, e2 : Ext c a) where
72 | shapesEqual : e1.shapeExt = e2.shapeExt
75 | valuesEqual : (p : c.Pos (e1.shapeExt)) ->
77 | e2.index (rewrite__impl (c.Pos) (sym shapesEqual) p)
82 | decEqExt : (e1, e2 : Ext c a) ->