diff --git a/src/ch04/s00-concerns.md b/src/ch04/s00-concerns.md index 13b9c95..fc56360 100644 --- a/src/ch04/s00-concerns.md +++ b/src/ch04/s00-concerns.md @@ -3,13 +3,13 @@ ## There exist alternative `Functor` implementations See the [relevant subchapter](./s01-alternatives.md) -## It might be better to have a per-lifetime trait for `Functor`s +## ~~It might be better to have a per-lifetime trait for `Functor`s~~ done See the [relevant subchapter](./s02-lifetimes.md) ## `Stackless` is kind of bad See the [relevant subchapter](./s03-stackless.md) -## `WeakFunctor::F<'a, A>` is not (yet) covariant over the lifetime `'a` +## `WeakFunctor<'a>` is not (yet) covariant over the lifetime `'a` See the [relevant subchapter](./s04-covariance.md) ## `Fail`/`FailMonad`/etc. have unclear semantics diff --git a/src/ch04/s01-alternatives.md b/src/ch04/s01-alternatives.md index 735e65b..29a200d 100644 --- a/src/ch04/s01-alternatives.md +++ b/src/ch04/s01-alternatives.md @@ -6,10 +6,8 @@ Copied for reference. All following examples are in the same `Functor`-`Applicat without extra (sub)traits like `WeakFunctor`, `Pure`, `ApplicativeLA2`, etc. . ```rust -trait Functor { - type F<'a, A: 'a>: 'a - where - Self: 'a; +trait Functor<'a>: 'a { + type F: 'a; fn fmap<'a, A: 'a, B: 'a>( f: impl 'a + FnOnce(A) -> B, fa: Self::F<'a, A>, diff --git a/src/ch04/s02-lifetimes.md b/src/ch04/s02-lifetimes.md index 0ff255b..8b97d27 100644 --- a/src/ch04/s02-lifetimes.md +++ b/src/ch04/s02-lifetimes.md @@ -2,17 +2,13 @@ Current: ```rust +pub trait WeakFunctorA<'a>: 'a { + type F: 'a; +} + pub trait WeakFunctor { type F<'a, A: 'a>: 'a where Self: 'a; } ``` - -Proposed: -```rust -pub trait WeakFunctor<'a>: 'a { - type F: 'a; -} -``` - diff --git a/src/ch04/s04-covariance.md b/src/ch04/s04-covariance.md index 0cb0c7a..46b62cc 100644 --- a/src/ch04/s04-covariance.md +++ b/src/ch04/s04-covariance.md @@ -1,4 +1,4 @@ -## `CovariantFunctor` not (yet) included in `Monad` +**`CovariantFunctor` was deleted.** ## Specific case: `Stackless<'a>` isn't covariant