0 | module Monocle.Compose
3 | import Monocle.Getter
6 | import Monocle.Optional
8 | import Monocle.Setter
9 | import Monocle.Traversal
19 | interface OSeq (0 k,l,m : Type -> Type -> Type -> Type -> Type) | k,l where
20 | seq : k s t a b -> l a b c d -> m s t c d
24 | public export %inline
25 | (.>) : {0 k,l,m : _} -> k s t a b -> l a b c d -> OSeq k l m => m s t c d
28 | public export %inline
29 | OSeq Iso Iso Iso where seq = (~>)
31 | public export %inline
32 | OSeq Iso Lens Lens where seq x y = toLens x ~> y
34 | public export %inline
35 | OSeq Iso Prism Prism where seq x y = toPrism x ~> y
37 | public export %inline
38 | OSeq Iso Optional Optional where seq x y = toOptional x ~> y
40 | public export %inline
41 | OSeq Iso Traversal Traversal where seq x y = toTraversal x ~> y
43 | public export %inline
44 | OSeq Iso Getter Getter where seq x y = toGetter x ~> y
46 | public export %inline
47 | OSeq Iso Setter Setter where seq x y = toSetter x ~> y
49 | public export %inline
50 | OSeq Iso Fold Fold where seq x y = toFold x ~> y
52 | public export %inline
53 | OSeq Lens Lens Lens where seq = (~>)
55 | public export %inline
56 | OSeq Lens Iso Lens where seq x y = x ~> toLens y
58 | public export %inline
59 | OSeq Lens Prism Optional where seq x y = toOptional x ~> toOptional y
61 | public export %inline
62 | OSeq Lens Optional Optional where seq x y = toOptional x ~> y
64 | public export %inline
65 | OSeq Lens Traversal Traversal where seq x y = toTraversal x ~> y
67 | public export %inline
68 | OSeq Lens Getter Getter where seq x y = toGetter x ~> y
70 | public export %inline
71 | OSeq Lens Setter Setter where seq x y = toSetter x ~> y
73 | public export %inline
74 | OSeq Lens Fold Fold where seq x y = toFold x ~> y
76 | public export %inline
77 | OSeq Prism Prism Prism where seq = (~>)
79 | public export %inline
80 | OSeq Prism Iso Prism where seq x y = x ~> toPrism y
82 | public export %inline
83 | OSeq Prism Lens Optional where seq x y = toOptional x ~> toOptional y
85 | public export %inline
86 | OSeq Prism Optional Optional where seq x y = toOptional x ~> y
88 | public export %inline
89 | OSeq Prism Traversal Traversal where seq x y = toTraversal x ~> y
91 | public export %inline
92 | OSeq Prism Getter Fold where seq x y = toFold x ~> toFold y
94 | public export %inline
95 | OSeq Prism Setter Setter where seq x y = toSetter x ~> y
97 | public export %inline
98 | OSeq Prism Fold Fold where seq x y = toFold x ~> y
100 | public export %inline
101 | OSeq Optional Optional Optional where seq = (~>)
103 | public export %inline
104 | OSeq Optional Iso Optional where seq x y = x ~> toOptional y
106 | public export %inline
107 | OSeq Optional Lens Optional where seq x y = x ~> toOptional y
109 | public export %inline
110 | OSeq Optional Prism Optional where seq x y = x ~> toOptional y
112 | public export %inline
113 | OSeq Optional Traversal Traversal where seq x y = toTraversal x ~> y
115 | public export %inline
116 | OSeq Optional Getter Fold where seq x y = toFold x ~> toFold y
118 | public export %inline
119 | OSeq Optional Setter Setter where seq x y = toSetter x ~> y
121 | public export %inline
122 | OSeq Optional Fold Fold where seq x y = toFold x ~> y
124 | public export %inline
125 | OSeq Traversal Traversal Traversal where seq = (~>)
127 | public export %inline
128 | OSeq Traversal Iso Traversal where seq x y = x ~> toTraversal y
130 | public export %inline
131 | OSeq Traversal Lens Traversal where seq x y = x ~> toTraversal y
133 | public export %inline
134 | OSeq Traversal Prism Traversal where seq x y = x ~> toTraversal y
136 | public export %inline
137 | OSeq Traversal Optional Traversal where seq x y = x ~> toTraversal y
139 | public export %inline
140 | OSeq Traversal Getter Fold where seq x y = toFold x ~> toFold y
142 | public export %inline
143 | OSeq Traversal Setter Setter where seq x y = toSetter x ~> y
145 | public export %inline
146 | OSeq Traversal Fold Fold where seq x y = toFold x ~> y
148 | public export %inline
149 | OSeq Setter Setter Setter where seq = (~>)
151 | public export %inline
152 | OSeq Setter Iso Setter where seq x y = x ~> toSetter y
154 | public export %inline
155 | OSeq Setter Lens Setter where seq x y = x ~> toSetter y
157 | public export %inline
158 | OSeq Setter Prism Setter where seq x y = x ~> toSetter y
160 | public export %inline
161 | OSeq Setter Optional Setter where seq x y = x ~> toSetter y
163 | public export %inline
164 | OSeq Setter Traversal Setter where seq x y = x ~> toSetter y
166 | public export %inline
167 | OSeq Getter Getter Getter where seq = (~>)
169 | public export %inline
170 | OSeq Getter Iso Getter where seq x y = x ~> toGetter y
172 | public export %inline
173 | OSeq Getter Lens Getter where seq x y = x ~> toGetter y
175 | public export %inline
176 | OSeq Getter Prism Fold where seq x y = toFold x ~> toFold y
178 | public export %inline
179 | OSeq Getter Optional Fold where seq x y = toFold x ~> toFold y
181 | public export %inline
182 | OSeq Getter Traversal Fold where seq x y = toFold x ~> toFold y
184 | public export %inline
185 | OSeq Getter Fold Fold where seq x y = toFold x ~> y
187 | public export %inline
188 | OSeq Fold Fold Fold where seq = (~>)
190 | public export %inline
191 | OSeq Fold Iso Fold where seq x y = x ~> toFold y
193 | public export %inline
194 | OSeq Fold Lens Fold where seq x y = x ~> toFold y
196 | public export %inline
197 | OSeq Fold Prism Fold where seq x y = x ~> toFold y
199 | public export %inline
200 | OSeq Fold Optional Fold where seq x y = x ~> toFold y
202 | public export %inline
203 | OSeq Fold Traversal Fold where seq x y = x ~> toFold y
205 | public export %inline
206 | OSeq Fold Getter Fold where seq x y = x ~> toFold y
209 | atO : Eq k => k -> Optional' (List (k,v)) v
210 | atO key = eqFirst key fst .> snd