This commit is contained in:
AF 2023-04-26 20:34:49 +00:00
parent 2e9d1ac221
commit d4e2b5338c
8 changed files with 32 additions and 5 deletions

1
book/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
book

14
book/book.toml Normal file
View File

@ -0,0 +1,14 @@
[book]
authors = ["Alisa Feistel"]
language = "en"
multilingual = false
src = "src"
title = "Monads in Rust"
[build]
create-missing = false
[output.html]
default-theme = "navy"
mathjax-support = true
git-repository-url = "https://gitea.parrrate.ru/PTV/radn-rs"

7
book/src/SUMMARY.md Normal file
View File

@ -0,0 +1,7 @@
# Summary
[Introduction](./ch00/s00-introduction.md)
- [Background](./ch01/s00-background.md)
- [Implementation](./ch02/s00-implementation.md)
- [Usage]()

View File

@ -0,0 +1 @@
# Introduction

View File

@ -0,0 +1 @@
# Background

View File

@ -0,0 +1 @@
# Implementation

View File

@ -30,8 +30,9 @@ impl Functor for OptionClass {
} }
fn void<'a, A: 'a>(fa: Self::F<'a, A>) -> Self::F<'a, ()> fn void<'a, A: 'a>(fa: Self::F<'a, A>) -> Self::F<'a, ()>
where where
Self: 'a, { Self: 'a,
{
fa?; fa?;
Self::pure(()) Self::pure(())
} }
@ -138,7 +139,7 @@ impl MonadFail<()> for OptionClass {
fn fail<'a, A: 'a>(_e: ()) -> Self::F<'a, A> fn fail<'a, A: 'a>(_e: ()) -> Self::F<'a, A>
where where
Self: 'a, Self: 'a,
(): 'a { {
None None
} }
} }

View File

@ -33,8 +33,9 @@ impl<E> Functor for ResultClass<E> {
} }
fn void<'a, A: 'a>(fa: Self::F<'a, A>) -> Self::F<'a, ()> fn void<'a, A: 'a>(fa: Self::F<'a, A>) -> Self::F<'a, ()>
where where
Self: 'a, { Self: 'a,
{
fa?; fa?;
Self::pure(()) Self::pure(())
} }