formatting fixes
This commit is contained in:
parent
f2b03c5ed7
commit
0c8babfcf3
@ -15,5 +15,7 @@
|
||||
- [All Errors](./exercises/all_errors.md)
|
||||
- [Chapter 3](./chapter_3.md)
|
||||
- [Composition](./exercises/composition.md)
|
||||
- [Covariance]()
|
||||
- [Option, Vec and BoxFuture<'a>]()
|
||||
|
||||
[Topics (Spoilers)](./topics.md)
|
||||
|
@ -1 +1 @@
|
||||
# Chapter 1
|
||||
# Chapter 1: Strict Tests
|
||||
|
@ -1 +1 @@
|
||||
# Chapter 3
|
||||
# Chapter 3: Overly Functional
|
||||
|
@ -1,6 +1,5 @@
|
||||
```rust
|
||||
# use std::ops::ControlFlow;
|
||||
|
||||
trait Monad<'a>: 'a {
|
||||
type W<A: 'a>: 'a;
|
||||
|
||||
@ -86,7 +85,6 @@ where
|
||||
# U::iterate(ComposedIteration(i))
|
||||
}
|
||||
}
|
||||
|
||||
# trait Local<'a>: Monad<'a> { fn wrap<A: 'a, M: Monad<'a>>(wa: Self::W<M::W<A>>) -> M::W<Self::W<A>>; }
|
||||
# struct CfInstance<E>(ControlFlow<(), E>);
|
||||
# use ControlFlow::{Continue, Break};
|
||||
|
@ -45,7 +45,8 @@
|
||||
## Solutions
|
||||
- [Implementation] used in rattlescript.
|
||||
- [Same solution] but with some extra comments.
|
||||
- [Another solution].
|
||||
- [Another solution]. I prefer this one.
|
||||
- There's an even simpler version that even an AI can generate (don't do that for `unsafe` code in production), but I dislike it for several reasons, even though it's mostly sound.
|
||||
|
||||
[Implementation]: https://github.com/HavenSelph/rattlescript/blob/f8bafb8b063b9bf056efb1ea14188db0624d981c/src/interpreter/value.rs#L21-L50
|
||||
[Same solution]: https://gist.github.com/timotheyca/7e46c9734653b2fcbe826ea4d13b9aa0
|
||||
|
@ -3,10 +3,13 @@
|
||||
Rows are ordered based on estimated difficulty.
|
||||
|
||||
| lifetimes\[-adjacent\] | `trait`s | `struct`s |
|
||||
|------------------------|--------------------|--------------|
|
||||
|------------------------|--------------------|---------------|
|
||||
| [explicit lifetimes] | [`Fn`?] | [`Duration`] |
|
||||
| [extracting lifetimes] | [exclusive traits] | [`RcChars`] |
|
||||
| [composition] | [merging traits] | [`AnyStr`] |
|
||||
| [extracting lifetimes] | [exclusive traits] | [All Errors?] |
|
||||
| [composition] | [merging traits] | [`RcChars`] |
|
||||
| | | [`AnyStr`] |
|
||||
|
||||
p.s. most of the exercises are actually about `trait`s, this categorisation isn't strict.
|
||||
|
||||
|
||||
[explicit lifetimes]: ./exercises/refbind.md
|
||||
@ -18,3 +21,4 @@ Rows are ordered based on estimated difficulty.
|
||||
[`AnyStr`]: ./exercises/anystr.md
|
||||
[composition]: ./exercises/composition.md
|
||||
[`Duration`]: ./exercises/duration.md
|
||||
[All Errors?]: ./exercises/all_errors.md
|
||||
|
Loading…
Reference in New Issue
Block a user