1#[fp_macros::document_module]
4mod inner {
5 use {
6 crate::{
7 Apply,
8 brands::{
9 FnBrand,
10 optics::*,
11 },
12 classes::{
13 monoid::Monoid,
14 optics::*,
15 profunctor::{
16 Choice,
17 Strong,
18 Wander,
19 },
20 *,
21 },
22 kinds::*,
23 },
24 fp_macros::*,
25 };
26
27 #[document_type_parameters(
32 "The lifetime of the values.",
33 "The reference-counted pointer type.",
34 "The source type of the structure.",
35 "The target type of the structure after an update.",
36 "The source type of the focus.",
37 "The target type of the focus after an update."
38 )]
39 pub struct Lens<'a, PointerBrand, S, T, A, B>
40 where
41 PointerBrand: UnsizedCoercible,
42 S: 'a,
43 T: 'a,
44 A: 'a,
45 B: 'a, {
46 pub(crate) to: Apply!(<FnBrand<PointerBrand> as Kind!( type Of<'b, U: 'b, V: 'b>: 'b; )>::Of<'a, S, (A, <FnBrand<PointerBrand> as CloneFn>::Of<'a, B, T>)>),
48 }
49
50 #[document_type_parameters(
51 "The lifetime of the values.",
52 "The reference-counted pointer type.",
53 "The source type of the structure.",
54 "The target type of the structure after an update.",
55 "The source type of the focus.",
56 "The target type of the focus after an update."
57 )]
58 #[document_parameters("The lens instance.")]
59 impl<'a, PointerBrand, S, T, A, B> Clone for Lens<'a, PointerBrand, S, T, A, B>
60 where
61 PointerBrand: UnsizedCoercible,
62 S: 'a,
63 T: 'a,
64 A: 'a,
65 B: 'a,
66 {
67 #[document_signature]
68 #[document_returns("A new `Lens` instance that is a copy of the original.")]
69 #[document_examples]
70 fn clone(&self) -> Self {
83 Lens {
84 to: self.to.clone(),
85 }
86 }
87 }
88
89 #[document_type_parameters(
90 "The lifetime of the values.",
91 "The reference-counted pointer type.",
92 "The source type of the structure.",
93 "The target type of the structure after an update.",
94 "The source type of the focus.",
95 "The target type of the focus after an update."
96 )]
97 #[document_parameters("The lens instance.")]
98 impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> Lens<'a, PointerBrand, S, T, A, B>
99 where
100 PointerBrand: UnsizedCoercible,
101 {
102 #[document_signature]
105 #[document_parameters("The getter/setter pair function.")]
107 #[document_returns("A new instance of the type.")]
109 #[document_examples]
111 pub fn new(
128 to: impl 'a + Fn(S) -> (A, <FnBrand<PointerBrand> as CloneFn>::Of<'a, B, T>)
129 ) -> Self {
130 Lens {
131 to: <FnBrand<PointerBrand> as LiftFn>::new(to),
132 }
133 }
134
135 #[document_signature]
137 #[document_parameters("The getter function.", "The setter function.")]
139 #[document_returns("A new `Lens` instance.")]
141 #[document_examples]
143 pub fn from_view_set(
154 view: impl 'a + Fn(S) -> A,
155 set: impl 'a + Fn((S, B)) -> T,
156 ) -> Self
157 where
158 S: Clone, {
159 let view_brand = <FnBrand<PointerBrand> as LiftFn>::new(view);
160 let set_brand = <FnBrand<PointerBrand> as LiftFn>::new(set);
161
162 Lens {
163 to: <FnBrand<PointerBrand> as LiftFn>::new(move |s: S| {
164 let s_clone = s.clone();
165 let set_brand = set_brand.clone();
166 (
167 view_brand(s),
168 <FnBrand<PointerBrand> as LiftFn>::new(move |b| {
169 set_brand((s_clone.clone(), b))
170 }),
171 )
172 }),
173 }
174 }
175
176 #[document_signature]
178 #[document_parameters("The structure to view.")]
180 #[document_returns("The focus value.")]
182 #[document_examples]
184 pub fn view(
195 &self,
196 s: S,
197 ) -> A {
198 (self.to)(s).0
199 }
200
201 #[document_signature]
203 #[document_parameters("The structure to update.", "The new value for the focus.")]
205 #[document_returns("The updated structure.")]
207 #[document_examples]
209 pub fn set(
220 &self,
221 s: S,
222 b: B,
223 ) -> T {
224 ((self.to)(s).1)(b)
225 }
226 }
227
228 #[document_type_parameters(
229 "The lifetime of the values.",
230 "The profunctor type.",
231 "The reference-counted pointer type.",
232 "The source type of the structure.",
233 "The target type of the structure after an update.",
234 "The source type of the focus.",
235 "The target type of the focus after an update."
236 )]
237 #[document_parameters("The lens instance.")]
238 impl<'a, Q, PointerBrand, S, T, A, B> Optic<'a, Q, S, T, A, B>
239 for Lens<'a, PointerBrand, S, T, A, B>
240 where
241 Q: Strong,
242 PointerBrand: UnsizedCoercible,
243 S: 'a,
244 T: 'a,
245 A: 'a,
246 B: 'a,
247 {
248 #[document_signature]
249 #[document_parameters("The profunctor value to transform.")]
250 #[document_returns("The transformed profunctor value.")]
251 #[document_examples]
252 fn evaluate(
276 &self,
277 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
278 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
279 let to = self.to.clone();
280
281 Q::dimap(
282 move |s: S| to(s),
283 move |(b, f): (B, <FnBrand<PointerBrand> as CloneFn>::Of<'a, B, T>)| f(b),
284 Q::first(pab),
285 )
286 }
287 }
288
289 #[document_type_parameters(
290 "The lifetime of the values.",
291 "The reference-counted pointer type.",
292 "The source type of the structure.",
293 "The target type of the structure after an update.",
294 "The source type of the focus.",
295 "The target type of the focus after an update."
296 )]
297 #[document_parameters("The lens instance.")]
298 impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> LensOptic<'a, S, T, A, B>
299 for Lens<'a, PointerBrand, S, T, A, B>
300 where
301 PointerBrand: UnsizedCoercible,
302 {
303 #[document_signature]
304 #[document_type_parameters("The profunctor type.")]
305 #[document_parameters("The profunctor value to transform.")]
306 #[document_returns("The transformed profunctor value.")]
307 #[document_examples]
308 fn evaluate<Q: Strong>(
332 &self,
333 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
334 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
335 Optic::<Q, S, T, A, B>::evaluate(self, pab)
336 }
337 }
338
339 #[document_type_parameters(
340 "The lifetime of the values.",
341 "The reference-counted pointer type.",
342 "The source type of the structure.",
343 "The target type of the structure after an update.",
344 "The source type of the focus.",
345 "The target type of the focus after an update."
346 )]
347 #[document_parameters("The lens instance.")]
348 impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> AffineTraversalOptic<'a, S, T, A, B>
349 for Lens<'a, PointerBrand, S, T, A, B>
350 where
351 PointerBrand: UnsizedCoercible,
352 {
353 #[document_signature]
354 #[document_type_parameters("The profunctor type.")]
355 #[document_parameters("The profunctor value to transform.")]
356 #[document_returns("The transformed profunctor value.")]
357 #[document_examples]
358 fn evaluate<Q: Strong + Choice>(
382 &self,
383 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
384 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
385 LensOptic::evaluate::<Q>(self, pab)
386 }
387 }
388
389 #[document_type_parameters(
390 "The lifetime of the values.",
391 "The reference-counted pointer type.",
392 "The source type of the structure.",
393 "The target type of the structure after an update.",
394 "The source type of the focus.",
395 "The target type of the focus after an update."
396 )]
397 #[document_parameters("The lens instance.")]
398 impl<'a, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> TraversalOptic<'a, S, T, A, B>
399 for Lens<'a, PointerBrand, S, T, A, B>
400 where
401 PointerBrand: UnsizedCoercible,
402 {
403 #[document_signature]
404 #[document_type_parameters("The profunctor type.")]
405 #[document_parameters("The profunctor value to transform.")]
406 #[document_returns("The transformed profunctor value.")]
407 #[document_examples]
408 fn evaluate<Q: Wander>(
432 &self,
433 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
434 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
435 LensOptic::evaluate::<Q>(self, pab)
436 }
437 }
438
439 #[document_type_parameters(
440 "The lifetime of the values.",
441 "The reference-counted pointer type.",
442 "The source type of the structure.",
443 "The focus type."
444 )]
445 #[document_parameters("The lens instance.")]
446 impl<'a, PointerBrand, S: 'a, A: 'a> GetterOptic<'a, S, A> for Lens<'a, PointerBrand, S, S, A, A>
447 where
448 PointerBrand: UnsizedCoercible,
449 {
450 #[document_signature]
451 #[document_type_parameters(
452 "The return type of the forget profunctor.",
453 "The reference-counted pointer type."
454 )]
455 #[document_parameters("The profunctor value to transform.")]
456 #[document_returns("The transformed profunctor value.")]
457 #[document_examples]
458 fn evaluate<R: 'a + 'static, Q: UnsizedCoercible + 'static>(
478 &self,
479 pab: Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
480 ) -> Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
481 {
482 LensOptic::evaluate::<ForgetBrand<Q, R>>(self, pab)
483 }
484 }
485
486 #[document_type_parameters(
487 "The lifetime of the values.",
488 "The reference-counted pointer type.",
489 "The source type of the structure.",
490 "The focus type."
491 )]
492 #[document_parameters("The lens instance.")]
493 impl<'a, PointerBrand, S: 'a, A: 'a> FoldOptic<'a, S, A> for Lens<'a, PointerBrand, S, S, A, A>
494 where
495 PointerBrand: UnsizedCoercible,
496 {
497 #[document_signature]
498 #[document_type_parameters("The monoid type.", "The reference-counted pointer type.")]
499 #[document_parameters("The profunctor value to transform.")]
500 #[document_returns("The transformed profunctor value.")]
501 #[document_examples]
502 fn evaluate<R: 'a + Monoid + 'static, Q: UnsizedCoercible + 'static>(
522 &self,
523 pab: Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
524 ) -> Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
525 {
526 LensOptic::evaluate::<ForgetBrand<Q, R>>(self, pab)
527 }
528 }
529
530 #[document_type_parameters(
531 "The lifetime of the values.",
532 "The reference-counted pointer type for the setter brand.",
533 "The reference-counted pointer type for the lens.",
534 "The source type of the structure.",
535 "The target type of the structure after an update.",
536 "The source type of the focus.",
537 "The target type of the focus after an update."
538 )]
539 #[document_parameters("The lens instance.")]
540 impl<'a, Q, PointerBrand, S: 'a, T: 'a, A: 'a, B: 'a> SetterOptic<'a, Q, S, T, A, B>
541 for Lens<'a, PointerBrand, S, T, A, B>
542 where
543 PointerBrand: UnsizedCoercible,
544 Q: UnsizedCoercible,
545 {
546 #[document_signature]
547 #[document_parameters("The profunctor value to transform.")]
548 #[document_returns("The transformed profunctor value.")]
549 #[document_examples]
550 fn evaluate(
574 &self,
575 pab: Apply!(<FnBrand<Q> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, B>),
576 ) -> Apply!(<FnBrand<Q> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, T>) {
577 LensOptic::evaluate::<FnBrand<Q>>(self, pab)
578 }
579 }
580
581 #[document_type_parameters(
586 "The lifetime of the values.",
587 "The reference-counted pointer type.",
588 "The type of the structure.",
589 "The type of the focus."
590 )]
591 pub struct LensPrime<'a, PointerBrand, S, A>
592 where
593 PointerBrand: UnsizedCoercible,
594 S: 'a,
595 A: 'a, {
596 pub(crate) to: Apply!(<FnBrand<PointerBrand> as Kind!( type Of<'b, U: 'b, V: 'b>: 'b; )>::Of<'a, S, (A, <FnBrand<PointerBrand> as CloneFn>::Of<'a, A, S>)>),
597 }
598
599 #[document_type_parameters(
600 "The lifetime of the values.",
601 "The reference-counted pointer type.",
602 "The type of the structure.",
603 "The type of the focus."
604 )]
605 #[document_parameters("The lens instance.")]
606 impl<'a, PointerBrand, S, A> Clone for LensPrime<'a, PointerBrand, S, A>
607 where
608 PointerBrand: UnsizedCoercible,
609 S: 'a,
610 A: 'a,
611 {
612 #[document_signature]
613 #[document_returns("A new `LensPrime` instance that is a copy of the original.")]
614 #[document_examples]
615 fn clone(&self) -> Self {
627 LensPrime {
628 to: self.to.clone(),
629 }
630 }
631 }
632
633 #[document_type_parameters(
634 "The lifetime of the values.",
635 "The reference-counted pointer type.",
636 "The type of the structure.",
637 "The type of the focus."
638 )]
639 #[document_parameters("The monomorphic lens instance.")]
640 impl<'a, PointerBrand, S: 'a, A: 'a> LensPrime<'a, PointerBrand, S, A>
641 where
642 PointerBrand: UnsizedCoercible,
643 {
644 #[document_signature]
647 #[document_parameters("The getter/setter pair function.")]
649 #[document_returns("A new instance of the type.")]
651 #[document_examples]
653 pub fn new(
669 to: impl 'a + Fn(S) -> (A, <FnBrand<PointerBrand> as CloneFn>::Of<'a, A, S>)
670 ) -> Self {
671 LensPrime {
672 to: <FnBrand<PointerBrand> as LiftFn>::new(to),
673 }
674 }
675
676 #[document_signature]
678 #[document_parameters("The getter function.", "The setter function.")]
680 #[document_returns("A new `LensPrime` instance.")]
682 #[document_examples]
684 pub fn from_view_set(
695 view: impl 'a + Fn(S) -> A,
696 set: impl 'a + Fn((S, A)) -> S,
697 ) -> Self
698 where
699 S: Clone, {
700 let view_brand = <FnBrand<PointerBrand> as LiftFn>::new(view);
701 let set_brand = <FnBrand<PointerBrand> as LiftFn>::new(set);
702
703 LensPrime {
704 to: <FnBrand<PointerBrand> as LiftFn>::new(move |s: S| {
705 let s_clone = s.clone();
706 let set_brand = set_brand.clone();
707 (
708 view_brand(s),
709 <FnBrand<PointerBrand> as LiftFn>::new(move |a| {
710 set_brand((s_clone.clone(), a))
711 }),
712 )
713 }),
714 }
715 }
716
717 #[document_signature]
719 #[document_parameters("The structure to view.")]
721 #[document_returns("The focus value.")]
723 #[document_examples]
725 pub fn view(
736 &self,
737 s: S,
738 ) -> A {
739 (self.to)(s).0
740 }
741
742 #[document_signature]
744 #[document_parameters("The structure to update.", "The new value for the focus.")]
746 #[document_returns("The updated structure.")]
748 #[document_examples]
750 pub fn set(
761 &self,
762 s: S,
763 a: A,
764 ) -> S {
765 ((self.to)(s).1)(a)
766 }
767
768 #[document_signature]
770 #[document_parameters("The structure to update.", "The function to apply to the focus.")]
772 #[document_returns("The updated structure.")]
774 #[document_examples]
776 pub fn over(
787 &self,
788 s: S,
789 f: impl Fn(A) -> A,
790 ) -> S {
791 let (a, set) = (self.to)(s);
792 set(f(a))
793 }
794 }
795
796 #[document_type_parameters(
799 "The lifetime of the values.",
800 "The profunctor type.",
801 "The reference-counted pointer type.",
802 "The type of the structure.",
803 "The type of the focus."
804 )]
805 #[document_parameters("The monomorphic lens instance.")]
806 impl<'a, Q, PointerBrand, S, A> Optic<'a, Q, S, S, A, A> for LensPrime<'a, PointerBrand, S, A>
807 where
808 Q: Strong,
809 PointerBrand: UnsizedCoercible,
810 S: 'a,
811 A: 'a,
812 {
813 #[document_signature]
814 #[document_parameters("The profunctor value to transform.")]
815 #[document_returns("The transformed profunctor value.")]
816 #[document_examples]
817 fn evaluate(
841 &self,
842 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
843 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>) {
844 let to = self.to.clone();
845
846 Q::dimap(
849 move |s: S| to(s),
850 move |(a, f): (A, <FnBrand<PointerBrand> as CloneFn>::Of<'a, A, S>)| f(a),
851 Q::first(pab),
852 )
853 }
854 }
855
856 #[document_type_parameters(
857 "The lifetime of the values.",
858 "The reference-counted pointer type.",
859 "The type of the structure.",
860 "The type of the focus."
861 )]
862 #[document_parameters("The monomorphic lens instance.")]
863 impl<'a, PointerBrand, S: 'a, A: 'a> AffineTraversalOptic<'a, S, S, A, A>
864 for LensPrime<'a, PointerBrand, S, A>
865 where
866 PointerBrand: UnsizedCoercible,
867 {
868 #[document_signature]
869 #[document_type_parameters("The profunctor type.")]
870 #[document_parameters("The profunctor value to transform.")]
871 #[document_returns("The transformed profunctor value.")]
872 #[document_examples]
873 fn evaluate<Q: Strong + Choice>(
897 &self,
898 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
899 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>) {
900 LensOptic::evaluate::<Q>(self, pab)
901 }
902 }
903
904 #[document_type_parameters(
905 "The lifetime of the values.",
906 "The reference-counted pointer type.",
907 "The type of the structure.",
908 "The type of the focus."
909 )]
910 #[document_parameters("The monomorphic lens instance.")]
911 impl<'a, PointerBrand, S: 'a, A: 'a> TraversalOptic<'a, S, S, A, A>
912 for LensPrime<'a, PointerBrand, S, A>
913 where
914 PointerBrand: UnsizedCoercible,
915 {
916 #[document_signature]
917 #[document_type_parameters("The profunctor type.")]
918 #[document_parameters("The profunctor value to transform.")]
919 #[document_returns("The transformed profunctor value.")]
920 #[document_examples]
921 fn evaluate<Q: Wander>(
945 &self,
946 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
947 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>) {
948 LensOptic::evaluate::<Q>(self, pab)
949 }
950 }
951
952 #[document_type_parameters(
953 "The lifetime of the values.",
954 "The reference-counted pointer type.",
955 "The type of the structure.",
956 "The type of the focus."
957 )]
958 #[document_parameters("The monomorphic lens instance.")]
959 impl<'a, PointerBrand, S: 'a, A: 'a> GetterOptic<'a, S, A> for LensPrime<'a, PointerBrand, S, A>
960 where
961 PointerBrand: UnsizedCoercible,
962 {
963 #[document_signature]
964 #[document_type_parameters(
965 "The return type of the forget profunctor.",
966 "The reference-counted pointer type."
967 )]
968 #[document_parameters("The profunctor value to transform.")]
969 #[document_returns("The transformed profunctor value.")]
970 #[document_examples]
971 fn evaluate<R: 'a + 'static, Q: UnsizedCoercible + 'static>(
991 &self,
992 pab: Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
993 ) -> Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
994 {
995 LensOptic::evaluate::<ForgetBrand<Q, R>>(self, pab)
996 }
997 }
998
999 #[document_type_parameters(
1000 "The lifetime of the values.",
1001 "The reference-counted pointer type.",
1002 "The type of the structure.",
1003 "The type of the focus."
1004 )]
1005 #[document_parameters("The monomorphic lens instance.")]
1006 impl<'a, PointerBrand, S: 'a, A: 'a> FoldOptic<'a, S, A> for LensPrime<'a, PointerBrand, S, A>
1007 where
1008 PointerBrand: UnsizedCoercible,
1009 {
1010 #[document_signature]
1011 #[document_type_parameters("The monoid type.", "The reference-counted pointer type.")]
1012 #[document_parameters("The profunctor value to transform.")]
1013 #[document_returns("The transformed profunctor value.")]
1014 #[document_examples]
1015 fn evaluate<R: 'a + Monoid + 'static, Q: UnsizedCoercible + 'static>(
1035 &self,
1036 pab: Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
1037 ) -> Apply!(<ForgetBrand<Q, R> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>)
1038 {
1039 LensOptic::evaluate::<ForgetBrand<Q, R>>(self, pab)
1040 }
1041 }
1042
1043 #[document_type_parameters(
1044 "The lifetime of the values.",
1045 "The reference-counted pointer type for the setter brand.",
1046 "The reference-counted pointer type for the lens.",
1047 "The type of the structure.",
1048 "The type of the focus."
1049 )]
1050 #[document_parameters("The monomorphic lens instance.")]
1051 impl<'a, Q, PointerBrand, S: 'a, A: 'a> SetterOptic<'a, Q, S, S, A, A>
1052 for LensPrime<'a, PointerBrand, S, A>
1053 where
1054 PointerBrand: UnsizedCoercible,
1055 Q: UnsizedCoercible,
1056 {
1057 #[document_signature]
1058 #[document_parameters("The profunctor value to transform.")]
1059 #[document_returns("The transformed profunctor value.")]
1060 #[document_examples]
1061 fn evaluate(
1085 &self,
1086 pab: Apply!(<FnBrand<Q> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
1087 ) -> Apply!(<FnBrand<Q> as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>) {
1088 LensOptic::evaluate::<FnBrand<Q>>(self, pab)
1089 }
1090 }
1091
1092 #[document_type_parameters(
1093 "The lifetime of the values.",
1094 "The reference-counted pointer type.",
1095 "The type of the structure.",
1096 "The type of the focus."
1097 )]
1098 #[document_parameters("The monomorphic lens instance.")]
1099 impl<'a, PointerBrand, S: 'a, A: 'a> LensOptic<'a, S, S, A, A> for LensPrime<'a, PointerBrand, S, A>
1100 where
1101 PointerBrand: UnsizedCoercible,
1102 {
1103 #[document_signature]
1104 #[document_type_parameters("The profunctor type.")]
1105 #[document_parameters("The profunctor value to transform.")]
1106 #[document_returns("The transformed profunctor value.")]
1107 #[document_examples]
1108 fn evaluate<Q: Strong>(
1132 &self,
1133 pab: Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, A, A>),
1134 ) -> Apply!(<Q as Kind!( type Of<'b, T: 'b, U: 'b>: 'b; )>::Of<'a, S, S>) {
1135 Optic::<Q, S, S, A, A>::evaluate(self, pab)
1136 }
1137 }
1138}
1139pub use inner::*;