diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 84bddcd..adba62b 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -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) diff --git a/src/chapter_1.md b/src/chapter_1.md index b743fda..dbb4082 100644 --- a/src/chapter_1.md +++ b/src/chapter_1.md @@ -1 +1 @@ -# Chapter 1 +# Chapter 1: Strict Tests diff --git a/src/chapter_3.md b/src/chapter_3.md index 9b2e616..f2934c4 100644 --- a/src/chapter_3.md +++ b/src/chapter_3.md @@ -1 +1 @@ -# Chapter 3 \ No newline at end of file +# Chapter 3: Overly Functional diff --git a/src/exercises/composition.md b/src/exercises/composition.md index d8cf910..af14bf1 100644 --- a/src/exercises/composition.md +++ b/src/exercises/composition.md @@ -1,6 +1,5 @@ ```rust # use std::ops::ControlFlow; - trait Monad<'a>: 'a { type W: 'a; @@ -86,7 +85,6 @@ where # U::iterate(ComposedIteration(i)) } } - # trait Local<'a>: Monad<'a> { fn wrap>(wa: Self::W>) -> M::W>; } # struct CfInstance(ControlFlow<(), E>); # use ControlFlow::{Continue, Break}; diff --git a/src/exercises/rcchars.md b/src/exercises/rcchars.md index c51ee7a..19ee5de 100644 --- a/src/exercises/rcchars.md +++ b/src/exercises/rcchars.md @@ -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 diff --git a/src/topics.md b/src/topics.md index 85d9296..e8f0cc3 100644 --- a/src/topics.md +++ b/src/topics.md @@ -2,11 +2,14 @@ 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`] | +| lifetimes\[-adjacent\] | `trait`s | `struct`s | +|------------------------|--------------------|---------------| +| [explicit lifetimes] | [`Fn`?] | [`Duration`] | +| [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