Diffstat (limited to 'src/protocol/visitor/sequence.rs')
| -rw-r--r-- | src/protocol/visitor/sequence.rs | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/protocol/visitor/sequence.rs b/src/protocol/visitor/sequence.rs index 1fa221c..340678f 100644 --- a/src/protocol/visitor/sequence.rs +++ b/src/protocol/visitor/sequence.rs @@ -1,8 +1,5 @@ use effectful::{ - effective::Effective, - environment::{DynBind, EnvConfig, Environment, InEnvironment, NativeForm}, - higher_ranked::Rank1, - SendSync, + effective::{Canonical, Effective}, environment::{Environment, InEnvironment}, higher_ranked::Rank1, DynBind, SendSync }; use crate::{ @@ -22,7 +19,7 @@ pub trait Sequence<'ctx, E: Environment>: DynBind<E> { fn visit<'a: 'c, 'b: 'c, 'c>( &'a mut self, scope: DynSequenceScope<'b, 'ctx, E>, - ) -> NativeForm<'c, VisitResult, E> + ) -> Canonical<'c, VisitResult, E> where 'ctx: 'a; } @@ -56,12 +53,12 @@ const _: () = { }; pub trait SequenceScope<'ctx, E: Environment>: DynBind<E> { - fn size_hint(&mut self) -> NativeForm<'_, (usize, Option<usize>), E>; + fn size_hint(&mut self) -> Canonical<'_, (usize, Option<usize>), E>; - fn next<'a: 'c, 'b: 'c, 'c>( + fn next<'a: 'c, 'lt: 'c, 'b: 'c, 'c>( &'a mut self, - visitor: DynVisitor<'b, 'ctx, E>, - ) -> NativeForm<'c, Flow, E> + visitor: DynVisitor<'b, 'lt, 'ctx, E>, + ) -> Canonical<'c, Flow, E> where 'ctx: 'c + 'a + 'b; } @@ -79,14 +76,14 @@ pub struct SequenceHint { } #[inline(always)] -pub fn visit_sequence<'a, 'ctx, E: Environment>( - visitor: DynVisitor<'a, 'ctx, E>, +pub fn visit_sequence<'a, 'lt, 'ctx, E: Environment>( + visitor: DynVisitor<'a, 'lt, 'ctx, E>, scope: DynSequenceScope<'a, 'ctx, E>, -) -> NativeForm<'a, VisitResult, E> { +) -> Canonical<'a, VisitResult, E> { if let Some(object) = visitor .0 .cast_mut() - .upcast_mut::<dyn Sequence<'ctx, E> + 'a>() + .upcast_mut::<dyn Sequence<'ctx, E> + 'lt>() { // Allow the visitor to walk the sequence scope. object.visit(scope) |