1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

//! Haskell-style monads that support `>>=` out of the box with Rust's `>>`.

#![cfg_attr(all(not(feature = "std"), not(test)), no_std)] // TODO: remove `not(test)` after https://github.com/rust-fuzz/arbitrary/pull/74
#![cfg_attr(feature = "nightly", feature(try_trait_v2))]
#![deny(warnings)]
#![warn(
    clippy::all,
    clippy::missing_docs_in_private_items,
    clippy::nursery,
    clippy::pedantic,
    clippy::restriction,
    clippy::cargo,
    missing_docs,
    rustdoc::all
)]
#![allow(
    clippy::blanket_clippy_restriction_lints,
    clippy::exhaustive_enums,
    clippy::exhaustive_structs,
    clippy::implicit_return,
    clippy::inline_always,
    clippy::mod_module_files,
    clippy::pub_use,
    clippy::separated_literal_suffix,
    clippy::single_char_lifetime_names
)]

pub mod prelude {
    //! In general, always import this with `use rsmonad::prelude::*;`.

    pub use derive_quickcheck::QuickCheck;
    pub use quickcheck;

    pub use super::entropy::*;
    pub use super::lazy::*;
    pub use super::macros::*;

    pub use super::alternative::*;
    pub use super::applicative::*;
    pub use super::fold::*;
    pub use super::functor::*;
    pub use super::monad::*;
    pub use super::monoid::*;

    pub use super::hazard::*;
    pub use super::maybe::*;
    pub use super::prod_u8::*;
    pub use super::sum_u8::*;

    #[cfg(feature = "std")]
    pub use super::with_std::*;
}

mod entropy;
mod lazy;
mod macros;

mod alternative;
mod applicative;
mod fold;
mod functor;
mod monad;
mod monoid;

mod hazard;
mod maybe;
mod prod_u8;
mod sum_u8;

mod orphans;

#[cfg(feature = "std")]
mod with_std;

#[cfg(all(test, feature = "std"))]
mod gallery;