lift lifetimes
This commit is contained in:
parent
f1dd33d61f
commit
b96a072b3a
@ -3,13 +3,13 @@
|
|||||||
## There exist alternative `Functor` implementations
|
## There exist alternative `Functor` implementations
|
||||||
See the [relevant subchapter](./s01-alternatives.md)
|
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)
|
See the [relevant subchapter](./s02-lifetimes.md)
|
||||||
|
|
||||||
## `Stackless` is kind of bad
|
## `Stackless` is kind of bad
|
||||||
See the [relevant subchapter](./s03-stackless.md)
|
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)
|
See the [relevant subchapter](./s04-covariance.md)
|
||||||
|
|
||||||
## `Fail`/`FailMonad`/etc. have unclear semantics
|
## `Fail`/`FailMonad`/etc. have unclear semantics
|
||||||
|
@ -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. .
|
without extra (sub)traits like `WeakFunctor`, `Pure`, `ApplicativeLA2`, etc. .
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
trait Functor {
|
trait Functor<'a>: 'a {
|
||||||
type F<'a, A: 'a>: 'a
|
type F<A: 'a>: 'a;
|
||||||
where
|
|
||||||
Self: 'a;
|
|
||||||
|
|
||||||
fn fmap<'a, A: 'a, B: 'a>(
|
fn fmap<'a, A: 'a, B: 'a>(
|
||||||
f: impl 'a + FnOnce(A) -> B, fa: Self::F<'a, A>,
|
f: impl 'a + FnOnce(A) -> B, fa: Self::F<'a, A>,
|
||||||
|
@ -2,17 +2,13 @@
|
|||||||
|
|
||||||
Current:
|
Current:
|
||||||
```rust
|
```rust
|
||||||
|
pub trait WeakFunctorA<'a>: 'a {
|
||||||
|
type F<A: 'a>: 'a;
|
||||||
|
}
|
||||||
|
|
||||||
pub trait WeakFunctor {
|
pub trait WeakFunctor {
|
||||||
type F<'a, A: 'a>: 'a
|
type F<'a, A: 'a>: 'a
|
||||||
where
|
where
|
||||||
Self: 'a;
|
Self: 'a;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Proposed:
|
|
||||||
```rust
|
|
||||||
pub trait WeakFunctor<'a>: 'a {
|
|
||||||
type F<A: 'a>: 'a;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## `CovariantFunctor` not (yet) included in `Monad`
|
**`CovariantFunctor` was deleted.**
|
||||||
|
|
||||||
## Specific case: `Stackless<'a>` isn't covariant
|
## Specific case: `Stackless<'a>` isn't covariant
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user