0 | module Data.Container.Additive.Morphism.Definition
2 | import Data.Container.Base
3 | import Data.ComMonoid
4 | import Data.Container.Additive.Object.Definition
12 | public export prefix 0 %!
13 | public export prefix 0 &!
14 | public export prefix 0 :!
15 | public export prefix 0 !%+
19 | namespace DependentLenses
24 | record (=%>) (c1, c2 : AddCont) where
26 | ULens : UC c1 =%> UC c2
31 | (!%+) : {0 c1, c2 : AddCont} ->
32 | ((x : c1.Shp) -> (y : c2.Shp ** (c2.Pos y -> c1.Pos x))) ->
34 | (!%+) f = (!%) ((!%) f)
37 | (%!) : {0 c1, c2 : AddCont} -> c1 =%> c2 -> (x : c1.Shp) -> (y : c2.Shp ** (c2.Pos y -> c1.Pos x))
38 | (%!) (!% f) = (%!) f
41 | (.fwd) : {0 c1, c2 : AddCont} -> c1 =%> c2 -> c1.Shp -> c2.Shp
42 | (.fwd) f = (ULens f).fwd
45 | (.bwd) : {0 c1, c2 : AddCont} -> (f : c1 =%> c2) ->
46 | (x : c1.Shp) -> c2.Pos (f.fwd x) -> c1.Pos x
47 | (.bwd) f = (ULens f).bwd
50 | compDepLens : {0 c1, c2, c3 : AddCont} -> c1 =%> c2 -> c2 =%> c3 -> c1 =%> c3
51 | compDepLens f g = (!%) (compDepLens (ULens f) (ULens g))
54 | (%>>) : {0 c1, c2, c3 : AddCont} -> c1 =%> c2 -> c2 =%> c3 -> c1 =%> c3
58 | id : {0 c : AddCont} -> c =%> c
70 | lensInputs : {c, d : AddCont} -> c =%> d -> AddCont
71 | lensInputs lens = MkAddCont
72 | (lensInputs (ULens lens))
73 | {mon=(MkI @{\s => ?lensInputsMon_rhs
})}
76 | namespace DependentCharts
81 | record (=&>) (c1, c2 : AddCont) where
83 | UChart : UC c1 =&> UC c2
86 | (&!) : {0 c1, c2 : AddCont} -> c1 =&> c2 -> (x : c1.Shp) -> (y : c2.Shp ** (c1.Pos x -> c2.Pos y))
87 | (&!) (!& f) = (&!) f
90 | (.fwd) : {0 c1, c2 : AddCont} -> c1 =&> c2 -> c1.Shp -> c2.Shp
91 | (.fwd) f = (UChart f).fwd
94 | (.bwd) : {0 c1, c2 : AddCont} -> (f : c1 =&> c2) ->
95 | (x : c1.Shp) -> c1.Pos x -> c2.Pos (f.fwd x)
96 | (.bwd) f = (UChart f).bwd
99 | compDepChart : {0 c1, c2, c3 : AddCont} -> c1 =&> c2 -> c2 =&> c3 -> c1 =&> c3
100 | compDepChart f g = (!&) (compDepChart (UChart f) (UChart g))
103 | (&>>) : {0 c1, c2, c3 : AddCont} -> c1 =&> c2 -> c2 =&> c3 -> c1 =&> c3
104 | (&>>) = compDepChart
107 | id : {0 c : AddCont} -> c =&> c
113 | chartInputs : {c, d : AddCont} -> (0 f : c =&> d) -> AddCont