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
30 | record (=%>) (c, d : AddCont) where
32 | ULens : UC c =%> UC d
37 | (!%+) : {0 c, d : AddCont} ->
38 | ((x : c.Shp) -> (y : d.Shp ** (d.Pos y -> c.Pos x))) ->
40 | (!%+) f = (!%) ((!%) f)
43 | (%!) : {0 c, d : AddCont} ->
44 | c =%> d -> (x : c.Shp) -> (y : d.Shp ** (d.Pos y -> c.Pos x))
45 | (%!) (!% f) = (%!) f
48 | (.fwd) : {0 c, d : AddCont} -> c =%> d -> c.Shp -> d.Shp
49 | (.fwd) f = (ULens f).fwd
52 | (.bwd) : {0 c, d : AddCont} -> (f : c =%> d) ->
53 | (x : c.Shp) -> d.Pos (f.fwd x) -> c.Pos x
54 | (.bwd) f = (ULens f).bwd
57 | compDepLens : {0 c, d, e : AddCont} -> c =%> d -> d =%> e -> c =%> e
58 | compDepLens f g = (!%) (compDepLens (ULens f) (ULens g))
61 | (%>>) : {0 c, d, e : AddCont} -> c =%> d -> d =%> e -> c =%> e
65 | id : {0 c : AddCont} -> c =%> c
77 | lensInputs : {c, d : AddCont} -> c =%> d -> AddCont
78 | lensInputs lens = MkAddCont
79 | (lensInputs (ULens lens))
80 | {mon=(MkI $
\s => ?lensInputsMon_rhs
)}
83 | namespace DependentCharts
94 | record (=&>) (c, d : AddCont) where
96 | UChart : UC c =&> UC d
99 | (&!) : {0 c, d : AddCont} -> c =&> d -> (x : c.Shp) -> (y : d.Shp ** (c.Pos x -> d.Pos y))
100 | (&!) (!& f) = (&!) f
103 | (.fwd) : {0 c, d : AddCont} -> c =&> d -> c.Shp -> d.Shp
104 | (.fwd) f = (UChart f).fwd
107 | (.bwd) : {0 c, d : AddCont} -> (f : c =&> d) ->
108 | (x : c.Shp) -> c.Pos x -> d.Pos (f.fwd x)
109 | (.bwd) f = (UChart f).bwd
112 | compDepChart : {0 c, d, e : AddCont} -> c =&> d -> d =&> e -> c =&> e
113 | compDepChart f g = (!&) (compDepChart (UChart f) (UChart g))
116 | (&>>) : {0 c, d, e : AddCont} -> c =&> d -> d =&> e -> c =&> e
117 | (&>>) = compDepChart
120 | id : {0 c : AddCont} -> c =&> c
126 | chartInputs : {c, d : AddCont} -> (0 f : c =&> d) -> AddCont