#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![allow(rustdoc::all)]
#![allow(
clippy::doc_overindented_list_items,
clippy::should_implement_trait,
clippy::type_complexity,
clippy::unnecessary_lazy_evaluations
)]
#![cfg_attr(
test,
allow(
clippy::bool_assert_comparison,
clippy::clone_on_copy,
clippy::empty_line_after_doc_comments,
clippy::let_unit_value,
clippy::map_identity,
clippy::redundant_closure,
clippy::unit_arg,
clippy::unit_cmp,
)
)]
pub mod algebra;
pub mod collections;
pub mod foundation;
pub mod reader;
pub mod result;
pub mod stm;
pub mod thunk;
pub use im;
pub use algebra::{
Alternative, Applicative, Bifunctor, Contravariant, Foldable, FreeAp, Functor, Invariant, Monad,
Monoid, Selective, Semigroup, sequence_vec, traverse_option, traverse_vec,
};
pub use collections::{
ChunkBuilder, EffectHashMap, EffectHashSet, EffectSortedMap, EffectSortedSet, EffectVector,
MutableHashMap, MutableHashSet, MutableList, MutableQueue, RedBlackTree, Trie, hash_map,
hash_set, sorted_map, sorted_set, vector,
};
pub use foundation::{Iso, Never, Unit};
pub use stm::{Outcome, Stm, TMap, TQueue, TRef, TSemaphore, Txn, atomically, commit};
#[cfg(test)]
pub(crate) mod test_support {
use id_effect::Effect;
use id_effect::{Cause, Exit};
pub(crate) fn run<A: Send + 'static, E: Send + 'static>(eff: Effect<A, E>) -> Result<A, E> {
match eff.block_on() {
Exit::Success(a) => Ok(a),
Exit::Failure(Cause::Fail(e)) => Err(e),
Exit::Failure(_) => panic!("effect died or was interrupted"),
}
}
}