From bb7719d6d050d7bf957f0df7a78e6c74b1c9615b Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sat, 18 Mar 2023 22:05:20 +0100 Subject: First few integration tests: trivial types --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 73469c3..c0783f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,9 +9,9 @@ macro_rules! free { Free(Box<$f>) } impl<$($other_lifetimes,)* $generic> $name<$($other_lifetimes,)* $generic>{ - $v fn lift_f(command : <$f as $crate::higher::Functor>::Target<$generic>) -> Self{ + $v fn lift_f(functor : <$f as $crate::higher::Functor>::Target<$generic>) -> Self{ use $crate::higher::Functor; - Self::Free(Box::new(command.fmap(|a| Self::Pure(a)))) + Self::Free(Box::new(functor.fmap(|a| Self::Pure(a)))) } $v fn retract<'free_macro_reserved_lifetime>(self) -> <$f as $crate::higher::Bind<'free_macro_reserved_lifetime,Self>>::Target<$generic> where $f : $crate::higher::Monad<'free_macro_reserved_lifetime,Self>, <$f as $crate::higher::Bind<'free_macro_reserved_lifetime,Self>>::Target<$generic> : $crate::higher::Pure<$generic> { @@ -43,7 +43,7 @@ macro_rules! free { } } - impl<'free_macro_reserved_lifetime, $($other_lifetimes,)* A> $crate::higher::Apply<'free_macro_reserved_lifetime, A> for $name<$($other_lifetimes,)* A> where A: 'free_macro_reserved_lifetime + Clone,{ + impl<'free_macro_reserved_lifetime, $($other_lifetimes,)* A> $crate::higher::Apply<'free_macro_reserved_lifetime, A> for $name<$($other_lifetimes,)* A> where A: 'free_macro_reserved_lifetime + Clone, Self : Clone { type Target = $name<$($other_lifetimes,)* T> where T:'free_macro_reserved_lifetime; fn apply( self, @@ -80,9 +80,9 @@ macro_rules! free { Free(Box<$f>) } impl<$($other_lifetimes : $a,)* $generic> $name<$($other_lifetimes,)* $generic> where $generic : $a { - $v fn lift_f(command : <$f as $crate::higher::Functor<$a, Self>>::Target<$generic>) -> Self{ + $v fn lift_f(functor : <$f as $crate::higher::Functor<$a, Self>>::Target<$generic>) -> Self{ use $crate::higher::Functor; - Self::Free(Box::new(command.fmap(|a| Self::Pure(a)))) + Self::Free(Box::new(functor.fmap(|a| Self::Pure(a)))) } $v fn retract(self) -> <$f as $crate::higher::Bind<$a,Self>>::Target<$generic> where $f : $crate::higher::Monad<$a,Self>, <$f as $crate::higher::Bind<$a,Self>>::Target<$generic> : $crate::higher::Pure<$generic> { @@ -118,7 +118,7 @@ macro_rules! free { } } - impl<$($other_lifetimes : $a,)* A> $crate::higher::Apply<$a, A> for $name<$($other_lifetimes,)* A> where A: $a + Clone,{ + impl<$($other_lifetimes : $a,)* A> $crate::higher::Apply<$a, A> for $name<$($other_lifetimes,)* A> where A: $a + Clone, Self : Clone{ type Target = $name<$($other_lifetimes,)* T> where T:$a; fn apply( self, -- cgit v1.2.3