"concerns" chapter
This commit is contained in:
parent
4fe248f77b
commit
509ffacd4c
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"rust-lang.rust-analyzer"
|
"rust-lang.rust-analyzer",
|
||||||
|
"yzhang.markdown-all-in-one"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -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)
|
||||||
|
32
book/src/ch04/s00-concerns.md
Normal file
32
book/src/ch04/s00-concerns.md
Normal 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;
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user