-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hello, this code:
#[derive(Functor)]
struct Identity<T>(std::marker::PhantomData<T>);Expands into this:
struct Identity<T>(std::marker::PhantomData<T>);
#[allow(absolute_paths_not_starting_with_crate)]
#[allow(bare_trait_objects)]
#[allow(deprecated)]
#[allow(drop_bounds)]
#[allow(dyn_drop)]
#[allow(non_camel_case_types)]
#[allow(trivial_bounds)]
#[allow(unused_qualifications)]
#[allow(clippy::allow)]
#[automatically_derived]
impl<T> Identity<T> {
pub fn fmap<__B>(self, __f: impl Fn(T) -> __B) -> Identity<__B>
where
T: Sized,
{
use ::functor_derive::*;
self.__fmap_0_ref(&__f)
}
pub fn try_fmap<__B, __E>(
self,
__f: impl Fn(T) -> Result<__B, __E>,
) -> Result<Identity<__B>, __E>
where
T: Sized,
{
use ::functor_derive::*;
self.__try_fmap_0_ref(&__f)
}
}
#[allow(absolute_paths_not_starting_with_crate)]
#[allow(bare_trait_objects)]
#[allow(deprecated)]
#[allow(drop_bounds)]
#[allow(dyn_drop)]
#[allow(non_camel_case_types)]
#[allow(trivial_bounds)]
#[allow(unused_qualifications)]
#[allow(clippy::allow)]
#[automatically_derived]
impl<T> Identity<T> {
pub fn __fmap_0_ref<__B>(self, __f: &impl Fn(T) -> __B) -> Identity<__B>
where
T: Sized,
{
use ::functor_derive::*;
Identity(self.0.__fmap_0_ref(__f))
}
pub fn __try_fmap_0_ref<__B, __E>(
self,
__f: &impl Fn(T) -> Result<__B, __E>,
) -> Result<Identity<__B>, __E>
where
T: Sized,
{
use ::functor_derive::*;
Ok(Identity(self.0.__try_fmap_0_ref(__f)?))
}
}But there is no implementation of ::functor_derive::Functor trait. So it can't be used generically. You can only call those methods, but you can't accept a generic functor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels