"concerns" chapter

This commit is contained in:
AF 2023-04-30 13:38:56 +00:00
parent 4fe248f77b
commit 509ffacd4c
3 changed files with 35 additions and 1 deletions

View File

@ -1,5 +1,6 @@
{ {
"recommendations": [ "recommendations": [
"rust-lang.rust-analyzer" "rust-lang.rust-analyzer",
"yzhang.markdown-all-in-one"
] ]
} }

View File

@ -5,3 +5,4 @@
- [Background](./ch01/s00-background.md) - [Background](./ch01/s00-background.md)
- [Implementation](./ch02/s00-implementation.md) - [Implementation](./ch02/s00-implementation.md)
- [Usage]() - [Usage]()
- [Current Implementation Concerns](./ch04/s00-concerns.md)

View File

@ -0,0 +1,32 @@
# Concerns (questions) with the current implementaion
## Can `WeakFunctor` be an associated type of a `Functor` instead of its supertype?
## `Clone`-`FnMut` category functors
## `Copy`-`Fn` category functors
## `WeakFunctor::F<'a, A>` is not (yet) covariant over the lifetime `'a`.
### Specific case: `Stackless<'a>` isn't covariant.
Current hypothesis is that this comes from `EvalTree<'a>` being invariant over `'a`
due to `FnOnce` being invariant over its output,
which in turn comes from present typesysten limitations.
## It might be better to have a per-lifetime trait for `Functor`s.
Current:
```rust
pub trait WeakFunctor {
type F<'a, A: 'a>: 'a
where
Self: 'a;
}
```
Proposed:
```rust
pub trait WeakFunctor<'a>: 'a {
type F<A: 'a>: 'a;
}
```