1use {
4 crate::{
5 Apply,
6 brands::{
7 FnBrand,
8 optics::*,
9 },
10 classes::{
11 CloneableFn,
12 UnsizedCoercible,
13 monoid::Monoid,
14 optics::*,
15 profunctor::{
16 Choice,
17 Closed,
18 Profunctor,
19 Strong,
20 Wander,
21 },
22 },
23 kinds::*,
24 },
25 fp_macros::*,
26 std::marker::PhantomData,
27};
28
29#[fp_macros::document_module]
30mod inner {
31 use super::*;
32
33 #[document_type_parameters(
36 "The lifetime of the values.",
37 "The source type of the outer structure.",
38 "The target type of the outer structure.",
39 "The source type of the intermediate structure.",
40 "The target type of the intermediate structure.",
41 "The source type of the focus.",
42 "The target type of the focus.",
43 "The first optic.",
44 "The second optic."
45 )]
46 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
47 pub struct Composed<'a, S, T, M, N, A, B, O1, O2> {
48 pub first: O1,
50 pub second: O2,
52 pub(crate) _phantom: PhantomData<&'a (S, T, M, N, A, B)>,
53 }
54
55 #[document_type_parameters(
56 "The lifetime of the values.",
57 "The source type of the outer structure.",
58 "The target type of the outer structure.",
59 "The source type of the intermediate structure.",
60 "The target type of the intermediate structure.",
61 "The source type of the focus.",
62 "The target type of the focus.",
63 "The first optic.",
64 "The second optic."
65 )]
66 impl<'a, S, T, M, N, A, B, O1, O2> Composed<'a, S, T, M, N, A, B, O1, O2> {
67 #[document_signature]
69 #[document_parameters(
71 "The outer optic (applied second).",
72 "The inner optic (applied first)."
73 )]
74 #[document_returns("A new instance of the type.")]
76 #[document_examples]
77 pub fn new(
109 first: O1,
110 second: O2,
111 ) -> Self {
112 Composed {
113 first,
114 second,
115 _phantom: PhantomData,
116 }
117 }
118 }
119
120 #[document_type_parameters(
121 "The lifetime of the values.",
122 "The profunctor type.",
123 "The source type of the outer structure.",
124 "The target type of the outer structure.",
125 "The source type of the intermediate structure.",
126 "The target type of the intermediate structure.",
127 "The source type of the focus.",
128 "The target type of the focus.",
129 "The first optic.",
130 "The second optic."
131 )]
132 #[document_parameters("The composed optic instance.")]
133 impl<'a, P, S: 'a, T: 'a, M: 'a, N: 'a, A: 'a, B: 'a, O1, O2> Optic<'a, P, S, T, A, B>
134 for Composed<'a, S, T, M, N, A, B, O1, O2>
135 where
136 P: Profunctor,
137 O1: Optic<'a, P, S, T, M, N>,
138 O2: Optic<'a, P, M, N, A, B>,
139 {
140 #[document_signature]
141 #[document_parameters("The profunctor value to transform.")]
142 #[document_returns("The transformed profunctor value.")]
143 #[document_examples]
144 fn evaluate(
176 &self,
177 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
178 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
179 let pmn = self.second.evaluate(pab);
180 self.first.evaluate(pmn)
181 }
182 }
183
184 #[document_type_parameters(
185 "The lifetime of the values.",
186 "The source type of the outer structure.",
187 "The target type of the outer structure.",
188 "The source type of the intermediate structure.",
189 "The target type of the intermediate structure.",
190 "The source type of the focus.",
191 "The target type of the focus.",
192 "The first optic.",
193 "The second optic."
194 )]
195 #[document_parameters("The composed optic instance.")]
196 impl<'a, S, T, M, N, A, B, O1, O2> IsoOptic<'a, S, T, A, B>
197 for Composed<'a, S, T, M, N, A, B, O1, O2>
198 where
199 O1: IsoOptic<'a, S, T, M, N>,
200 O2: IsoOptic<'a, M, N, A, B>,
201 {
202 #[document_signature]
203 #[document_type_parameters("The profunctor type.")]
204 #[document_parameters("The profunctor value to transform.")]
205 #[document_returns("The transformed profunctor value.")]
206 #[document_examples]
207 fn evaluate<P: Profunctor + 'static>(
237 &self,
238 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
239 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
240 let pmn = IsoOptic::evaluate::<P>(&self.second, pab);
241 IsoOptic::evaluate::<P>(&self.first, pmn)
242 }
243 }
244
245 #[document_type_parameters(
246 "The lifetime of the values.",
247 "The source type of the outer structure.",
248 "The target type of the outer structure.",
249 "The source type of the intermediate structure.",
250 "The target type of the intermediate structure.",
251 "The source type of the focus.",
252 "The target type of the focus.",
253 "The first optic.",
254 "The second optic."
255 )]
256 #[document_parameters("The composed optic instance.")]
257 impl<'a, S, T, M, N, A, B, O1, O2> LensOptic<'a, S, T, A, B>
258 for Composed<'a, S, T, M, N, A, B, O1, O2>
259 where
260 O1: LensOptic<'a, S, T, M, N>,
261 O2: LensOptic<'a, M, N, A, B>,
262 {
263 #[document_signature]
264 #[document_type_parameters("The profunctor type.")]
265 #[document_parameters("The profunctor value to transform.")]
266 #[document_returns("The transformed profunctor value.")]
267 #[document_examples]
268 fn evaluate<P: Strong>(
301 &self,
302 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
303 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
304 let pmn = LensOptic::evaluate::<P>(&self.second, pab);
305 LensOptic::evaluate::<P>(&self.first, pmn)
306 }
307 }
308
309 #[document_type_parameters(
310 "The lifetime of the values.",
311 "The source type of the outer structure.",
312 "The target type of the outer structure.",
313 "The source type of the intermediate structure.",
314 "The target type of the intermediate structure.",
315 "The source type of the focus.",
316 "The target type of the focus.",
317 "The first optic.",
318 "The second optic."
319 )]
320 #[document_parameters("The composed optic instance.")]
321 impl<'a, S, T, M, N, A, B, O1, O2> PrismOptic<'a, S, T, A, B>
322 for Composed<'a, S, T, M, N, A, B, O1, O2>
323 where
324 O1: PrismOptic<'a, S, T, M, N>,
325 O2: PrismOptic<'a, M, N, A, B>,
326 {
327 #[document_signature]
328 #[document_type_parameters("The profunctor type.")]
329 #[document_parameters("The profunctor value to transform.")]
330 #[document_returns("The transformed profunctor value.")]
331 #[document_examples]
332 fn evaluate<P: Choice>(
363 &self,
364 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
365 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
366 let pmn = PrismOptic::evaluate::<P>(&self.second, pab);
367 PrismOptic::evaluate::<P>(&self.first, pmn)
368 }
369 }
370
371 #[document_type_parameters(
372 "The lifetime of the values.",
373 "The source type of the outer structure.",
374 "The target type of the outer structure.",
375 "The source type of the intermediate structure.",
376 "The target type of the intermediate structure.",
377 "The source type of the focus.",
378 "The target type of the focus.",
379 "The first optic.",
380 "The second optic."
381 )]
382 #[document_parameters("The composed optic instance.")]
383 impl<'a, S, T, M, N, A, B, O1, O2> AffineTraversalOptic<'a, S, T, A, B>
384 for Composed<'a, S, T, M, N, A, B, O1, O2>
385 where
386 O1: AffineTraversalOptic<'a, S, T, M, N>,
387 O2: AffineTraversalOptic<'a, M, N, A, B>,
388 {
389 #[document_signature]
390 #[document_type_parameters("The profunctor type.")]
391 #[document_parameters("The profunctor value to transform.")]
392 #[document_returns("The transformed profunctor value.")]
393 #[document_examples]
394 fn evaluate<P: Strong + Choice>(
428 &self,
429 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
430 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
431 let pmn = AffineTraversalOptic::evaluate::<P>(&self.second, pab);
432 AffineTraversalOptic::evaluate::<P>(&self.first, pmn)
433 }
434 }
435
436 #[document_type_parameters(
437 "The lifetime of the values.",
438 "The source type of the outer structure.",
439 "The target type of the outer structure.",
440 "The source type of the intermediate structure.",
441 "The target type of the intermediate structure.",
442 "The source type of the focus.",
443 "The target type of the focus.",
444 "The first optic.",
445 "The second optic."
446 )]
447 #[document_parameters("The composed optic instance.")]
448 impl<'a, S, T, M, N, A, B, O1, O2> TraversalOptic<'a, S, T, A, B>
449 for Composed<'a, S, T, M, N, A, B, O1, O2>
450 where
451 O1: TraversalOptic<'a, S, T, M, N>,
452 O2: TraversalOptic<'a, M, N, A, B>,
453 {
454 #[document_signature]
455 #[document_type_parameters("The profunctor type.")]
456 #[document_parameters("The profunctor value to transform.")]
457 #[document_returns("The transformed profunctor value.")]
458 #[document_examples]
459 fn evaluate<P: Wander>(
491 &self,
492 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
493 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
494 let pmn = TraversalOptic::evaluate::<P>(&self.second, pab);
495 TraversalOptic::evaluate::<P>(&self.first, pmn)
496 }
497 }
498
499 #[document_type_parameters(
500 "The lifetime of the values.",
501 "The source type of the structure.",
502 "The focus type.",
503 "The intermediate type.",
504 "The first optic.",
505 "The second optic."
506 )]
507 #[document_parameters("The composed optic instance.")]
508 impl<'a, S, A, M, O1, O2> GetterOptic<'a, S, A> for Composed<'a, S, S, M, M, A, A, O1, O2>
509 where
510 O1: GetterOptic<'a, S, M>,
511 O2: GetterOptic<'a, M, A>,
512 M: 'a,
513 A: 'a,
514 {
515 #[document_signature]
516 #[document_type_parameters(
517 "The return type of the forget profunctor.",
518 "The reference-counted pointer type."
519 )]
520 #[document_parameters("The profunctor value to transform.")]
521 #[document_returns("The transformed profunctor value.")]
522 #[document_examples]
523 fn evaluate<R: 'a + 'static, PointerBrand: UnsizedCoercible + 'static>(
553 &self,
554 pab: Apply!(<ForgetBrand<PointerBrand, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
555 ) -> Apply!(<ForgetBrand<PointerBrand, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
556 {
557 let pmn = GetterOptic::evaluate::<R, PointerBrand>(&self.second, pab);
558 GetterOptic::evaluate::<R, PointerBrand>(&self.first, pmn)
559 }
560 }
561
562 #[document_type_parameters(
563 "The lifetime of the values.",
564 "The source type of the structure.",
565 "The focus type.",
566 "The intermediate type.",
567 "The first optic.",
568 "The second optic."
569 )]
570 #[document_parameters("The composed optic instance.")]
571 impl<'a, S, A, M, O1, O2> FoldOptic<'a, S, A> for Composed<'a, S, S, M, M, A, A, O1, O2>
572 where
573 O1: FoldOptic<'a, S, M>,
574 O2: FoldOptic<'a, M, A>,
575 M: 'a,
576 A: 'a,
577 {
578 #[document_signature]
579 #[document_type_parameters("The monoid type.", "The reference-counted pointer type.")]
580 #[document_parameters("The profunctor value to transform.")]
581 #[document_returns("The transformed profunctor value.")]
582 #[document_examples]
583 fn evaluate<R: 'a + Monoid + Clone + 'static, PointerBrand: UnsizedCoercible + 'static>(
616 &self,
617 pab: Apply!(<ForgetBrand<PointerBrand, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
618 ) -> Apply!(<ForgetBrand<PointerBrand, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
619 {
620 let pmn = FoldOptic::evaluate::<R, PointerBrand>(&self.second, pab);
621 FoldOptic::evaluate::<R, PointerBrand>(&self.first, pmn)
622 }
623 }
624
625 #[document_type_parameters(
626 "The lifetime of the values.",
627 "The reference-counted pointer type for the Setter brand.",
628 "The source type of the outer structure.",
629 "The target type of the outer structure.",
630 "The source type of the intermediate structure.",
631 "The target type of the intermediate structure.",
632 "The source type of the focus.",
633 "The target type of the focus.",
634 "The first optic.",
635 "The second optic."
636 )]
637 #[document_parameters("The composed optic instance.")]
638 impl<'a, PointerBrand, S, T, M, N, A, B, O1, O2> SetterOptic<'a, PointerBrand, S, T, A, B>
639 for Composed<'a, S, T, M, N, A, B, O1, O2>
640 where
641 PointerBrand: UnsizedCoercible,
642 O1: SetterOptic<'a, PointerBrand, S, T, M, N>,
643 O2: SetterOptic<'a, PointerBrand, M, N, A, B>,
644 M: 'a,
645 N: 'a,
646 {
647 #[document_signature]
648 #[document_parameters("The profunctor value to transform.")]
649 #[document_returns("The transformed profunctor value.")]
650 #[document_examples]
651 fn evaluate(
684 &self,
685 pab: Apply!(<FnBrand<PointerBrand> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
686 ) -> Apply!(<FnBrand<PointerBrand> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>)
687 {
688 let pmn = SetterOptic::evaluate(&self.second, pab);
689 SetterOptic::evaluate(&self.first, pmn)
690 }
691 }
692
693 #[document_type_parameters(
694 "The lifetime of the values.",
695 "The source type of the outer structure.",
696 "The target type of the outer structure.",
697 "The source type of the intermediate structure.",
698 "The target type of the intermediate structure.",
699 "The source type of the focus.",
700 "The target type of the focus.",
701 "The first optic.",
702 "The second optic."
703 )]
704 #[document_parameters("The composed optic instance.")]
705 impl<'a, S, T, M, N, A, B, O1, O2> ReviewOptic<'a, S, T, A, B>
706 for Composed<'a, S, T, M, N, A, B, O1, O2>
707 where
708 O1: ReviewOptic<'a, S, T, M, N>,
709 O2: ReviewOptic<'a, M, N, A, B>,
710 M: 'a,
711 N: 'a,
712 {
713 #[document_signature]
714 #[document_parameters("The profunctor value to transform.")]
715 #[document_returns("The transformed profunctor value.")]
716 #[document_examples]
717 fn evaluate(
747 &self,
748 pab: Apply!(<TaggedBrand as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
749 ) -> Apply!(<TaggedBrand as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
750 let pmn = ReviewOptic::evaluate(&self.second, pab);
751 ReviewOptic::evaluate(&self.first, pmn)
752 }
753 }
754
755 #[document_type_parameters(
756 "The lifetime of the values.",
757 "The cloneable function brand used by the profunctor's `Closed` instance.",
758 "The source type of the outer structure.",
759 "The target type of the outer structure.",
760 "The source type of the intermediate structure.",
761 "The target type of the intermediate structure.",
762 "The source type of the focus.",
763 "The target type of the focus.",
764 "The first optic.",
765 "The second optic."
766 )]
767 #[document_parameters("The composed optic instance.")]
768 impl<'a, FunctionBrand: CloneableFn, S, T, M, N, A, B, O1, O2>
769 GrateOptic<'a, FunctionBrand, S, T, A, B> for Composed<'a, S, T, M, N, A, B, O1, O2>
770 where
771 O1: GrateOptic<'a, FunctionBrand, S, T, M, N>,
772 O2: GrateOptic<'a, FunctionBrand, M, N, A, B>,
773 {
774 #[document_signature]
775 #[document_type_parameters("The profunctor type.")]
776 #[document_parameters("The profunctor value to transform.")]
777 #[document_returns("The transformed profunctor value.")]
778 #[document_examples]
779 fn evaluate<P: Closed<FunctionBrand>>(
811 &self,
812 pab: Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
813 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
814 let pmn = GrateOptic::<FunctionBrand, M, N, A, B>::evaluate::<P>(&self.second, pab);
815 GrateOptic::<FunctionBrand, S, T, M, N>::evaluate::<P>(&self.first, pmn)
816 }
817 }
818
819 #[document_signature]
827 #[document_type_parameters(
829 "The lifetime of the values.",
830 "The source type of the outer structure.",
831 "The target type of the outer structure.",
832 "The source type of the intermediate structure.",
833 "The target type of the intermediate structure.",
834 "The source type of the focus.",
835 "The target type of the focus.",
836 "The first optic.",
837 "The second optic."
838 )]
839 #[document_parameters("The outer optic (applied second).", "The inner optic (applied first).")]
841 #[document_examples]
843 pub fn optics_compose<'a, S: 'a, T: 'a, M: 'a, N: 'a, A: 'a, B: 'a, O1, O2>(
901 first: O1,
902 second: O2,
903 ) -> Composed<'a, S, T, M, N, A, B, O1, O2> {
904 Composed::new(first, second)
905 }
906
907 #[document_type_parameters(
908 "The lifetime of the values.",
909 "The index type.",
910 "The source type of the outer structure.",
911 "The target type of the outer structure.",
912 "The source type of the intermediate structure.",
913 "The target type of the intermediate structure.",
914 "The source type of the focus.",
915 "The target type of the focus.",
916 "The first optic.",
917 "The second optic."
918 )]
919 #[document_parameters("The composed optic instance.")]
920 impl<'a, I: 'a, S: 'a, T: 'a, M: 'a, N: 'a, A: 'a, B: 'a, O1, O2>
921 IndexedLensOptic<'a, I, S, T, A, B> for Composed<'a, S, T, M, N, A, B, O1, O2>
922 where
923 O1: LensOptic<'a, S, T, M, N>,
924 O2: IndexedLensOptic<'a, I, M, N, A, B>,
925 {
926 #[document_signature]
927 #[document_type_parameters("The profunctor type.")]
928 #[document_parameters("The indexed profunctor value to transform.")]
929 #[document_returns("The transformed profunctor value.")]
930 #[document_examples]
931 fn evaluate<P: Strong>(
965 &self,
966 pab: crate::types::optics::Indexed<'a, P, I, A, B>,
967 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
968 let pmn = self.second.evaluate(pab);
969 self.first.evaluate::<P>(pmn)
970 }
971 }
972
973 #[document_type_parameters(
974 "The lifetime of the values.",
975 "The index type.",
976 "The source type of the outer structure.",
977 "The target type of the outer structure.",
978 "The source type of the intermediate structure.",
979 "The target type of the intermediate structure.",
980 "The source type of the focus.",
981 "The target type of the focus.",
982 "The first optic.",
983 "The second optic."
984 )]
985 #[document_parameters("The composed optic instance.")]
986 impl<'a, I: 'a, S: 'a, T: 'a, M: 'a, N: 'a, A: 'a, B: 'a, O1, O2>
987 IndexedTraversalOptic<'a, I, S, T, A, B> for Composed<'a, S, T, M, N, A, B, O1, O2>
988 where
989 O1: TraversalOptic<'a, S, T, M, N>,
990 O2: IndexedTraversalOptic<'a, I, M, N, A, B>,
991 {
992 #[document_signature]
993 #[document_type_parameters("The profunctor type.")]
994 #[document_parameters("The indexed profunctor value to transform.")]
995 #[document_returns("The transformed profunctor value.")]
996 #[document_examples]
997 fn evaluate<P: Wander>(
1031 &self,
1032 pab: crate::types::optics::Indexed<'a, P, I, A, B>,
1033 ) -> Apply!(<P as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
1034 let pmn = self.second.evaluate(pab);
1035 self.first.evaluate::<P>(pmn)
1036 }
1037 }
1038
1039 #[document_type_parameters(
1040 "The lifetime of the values.",
1041 "The index type.",
1042 "The source type of the structure.",
1043 "The focus type.",
1044 "The intermediate type.",
1045 "The first optic.",
1046 "The second optic."
1047 )]
1048 #[document_parameters("The composed optic instance.")]
1049 impl<'a, I: 'a, S: 'a, A: 'a, M: 'a, O1, O2> IndexedGetterOptic<'a, I, S, A>
1050 for Composed<'a, S, S, M, M, A, A, O1, O2>
1051 where
1052 O1: GetterOptic<'a, S, M>,
1053 O2: IndexedGetterOptic<'a, I, M, A>,
1054 {
1055 #[document_signature]
1056 #[document_type_parameters(
1057 "The return type of the forget profunctor.",
1058 "The reference-counted pointer type."
1059 )]
1060 #[document_parameters("The indexed profunctor value to transform.")]
1061 #[document_returns("The transformed profunctor value.")]
1062 #[document_examples]
1063 fn evaluate<R: 'a + 'static, PointerBrand: UnsizedCoercible + 'static>(
1095 &self,
1096 pab: crate::types::optics::Indexed<'a, ForgetBrand<PointerBrand, R>, I, A, A>,
1097 ) -> Apply!(<ForgetBrand<PointerBrand, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
1098 {
1099 let pmn = self.second.evaluate::<R, PointerBrand>(pab);
1100 self.first.evaluate::<R, PointerBrand>(pmn)
1101 }
1102 }
1103
1104 #[document_type_parameters(
1105 "The lifetime of the values.",
1106 "The index type.",
1107 "The source type of the structure.",
1108 "The focus type.",
1109 "The intermediate type.",
1110 "The first optic.",
1111 "The second optic."
1112 )]
1113 #[document_parameters("The composed optic instance.")]
1114 impl<'a, I: 'a, S: 'a, A: 'a, M: 'a, O1, O2> IndexedFoldOptic<'a, I, S, A>
1115 for Composed<'a, S, S, M, M, A, A, O1, O2>
1116 where
1117 O1: FoldOptic<'a, S, M>,
1118 O2: IndexedFoldOptic<'a, I, M, A>,
1119 {
1120 #[document_signature]
1121 #[document_type_parameters("The monoid type.", "The reference-counted pointer type.")]
1122 #[document_parameters("The indexed profunctor value to transform.")]
1123 #[document_returns("The transformed profunctor value.")]
1124 #[document_examples]
1125 fn evaluate<R: 'a + Monoid + Clone + 'static, PointerBrand: UnsizedCoercible + 'static>(
1157 &self,
1158 pab: crate::types::optics::Indexed<'a, ForgetBrand<PointerBrand, R>, I, A, A>,
1159 ) -> Apply!(<ForgetBrand<PointerBrand, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
1160 {
1161 let pmn = self.second.evaluate::<R, PointerBrand>(pab);
1162 self.first.evaluate::<R, PointerBrand>(pmn)
1163 }
1164 }
1165
1166 #[document_type_parameters(
1167 "The lifetime of the values.",
1168 "The reference-counted pointer type for the Setter brand.",
1169 "The index type.",
1170 "The source type of the outer structure.",
1171 "The target type of the outer structure.",
1172 "The source type of the intermediate structure.",
1173 "The target type of the intermediate structure.",
1174 "The source type of the focus.",
1175 "The target type of the focus.",
1176 "The first optic.",
1177 "The second optic."
1178 )]
1179 #[document_parameters("The composed optic instance.")]
1180 impl<'a, PointerBrand, I: 'a, S: 'a, T: 'a, M: 'a, N: 'a, A: 'a, B: 'a, O1, O2>
1181 IndexedSetterOptic<'a, PointerBrand, I, S, T, A, B> for Composed<'a, S, T, M, N, A, B, O1, O2>
1182 where
1183 PointerBrand: UnsizedCoercible,
1184 O1: SetterOptic<'a, PointerBrand, S, T, M, N>,
1185 O2: IndexedSetterOptic<'a, PointerBrand, I, M, N, A, B>,
1186 {
1187 #[document_signature]
1188 #[document_parameters("The indexed profunctor value to transform.")]
1189 #[document_returns("The transformed profunctor value.")]
1190 #[document_examples]
1191 fn evaluate(
1225 &self,
1226 pab: crate::types::optics::Indexed<'a, FnBrand<PointerBrand>, I, A, B>,
1227 ) -> Apply!(<FnBrand<PointerBrand> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>)
1228 {
1229 let pmn = self.second.evaluate(pab);
1230 self.first.evaluate(pmn)
1231 }
1232 }
1233}
1234pub use inner::*;