func
restructuring
This commit is contained in:
parent
1a8d70957b
commit
8a71fae804
@ -1,6 +1,4 @@
|
|||||||
use fail::*;
|
use crate::func::{applicative_select::*, fail::*, *};
|
||||||
|
|
||||||
use crate::func::*;
|
|
||||||
|
|
||||||
type Frwa<'a, A, E0, E1, Fallible> =
|
type Frwa<'a, A, E0, E1, Fallible> =
|
||||||
Wrap<'a, Result<WrapE<'a, A, E0, Fallible>, E1>, <Fallible as MonadFailAny<'a>>::T>;
|
Wrap<'a, Result<WrapE<'a, A, E0, Fallible>, E1>, <Fallible as MonadFailAny<'a>>::T>;
|
||||||
|
10
src/func.rs
10
src/func.rs
@ -7,12 +7,12 @@
|
|||||||
//! * <https://hackage.haskell.org/package/base-4.18.0.0/docs/Control-Applicative.html>
|
//! * <https://hackage.haskell.org/package/base-4.18.0.0/docs/Control-Applicative.html>
|
||||||
//! * <https://hackage.haskell.org/package/base-4.18.0.0/docs/Control-Monad.html>
|
//! * <https://hackage.haskell.org/package/base-4.18.0.0/docs/Control-Monad.html>
|
||||||
|
|
||||||
mod applicative_select;
|
pub mod applicative_select;
|
||||||
pub mod class_prelude;
|
pub mod class_prelude;
|
||||||
pub mod context;
|
pub mod context;
|
||||||
pub mod controlflow;
|
pub mod controlflow;
|
||||||
pub mod derivations;
|
pub mod derivations;
|
||||||
mod extensions;
|
pub mod extensions;
|
||||||
pub mod fail;
|
pub mod fail;
|
||||||
pub mod instances;
|
pub mod instances;
|
||||||
pub mod local;
|
pub mod local;
|
||||||
@ -23,9 +23,7 @@ pub mod test_suite;
|
|||||||
pub mod tests;
|
pub mod tests;
|
||||||
pub mod weakfunctorany;
|
pub mod weakfunctorany;
|
||||||
|
|
||||||
pub use self::applicative_select::{
|
use self::applicative_select::ApplicativeSelect;
|
||||||
ApplicativeSelect, ApplicativeSelectExt, Selected, SelectedWrapped,
|
|
||||||
};
|
|
||||||
use self::controlflow::{ControlFlow, Iterative};
|
use self::controlflow::{ControlFlow, Iterative};
|
||||||
pub use self::extensions::MonadExt;
|
pub use self::extensions::MonadExt;
|
||||||
|
|
||||||
@ -126,5 +124,3 @@ pub trait Monad<'a>: Applicative<'a> {
|
|||||||
Self::bind(ffa, |fa| fa)
|
Self::bind(ffa, |fa| fa)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: Monad<'a>> MonadExt<'a> for T {}
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
pub use super::{
|
pub use super::{
|
||||||
|
applicative_select::{ApplicativeSelect, ApplicativeSelectExt, Selected, SelectedWrapped},
|
||||||
controlflow::{ControlFlow, Iterative, IterativeWrapped},
|
controlflow::{ControlFlow, Iterative, IterativeWrapped},
|
||||||
extensions::MonadExt,
|
extensions::MonadExt,
|
||||||
fail::{Fail, MonadFail, MonadFailAny, MonadFailAnyExt, WrapE},
|
fail::{Fail, MonadFail, MonadFailAny, MonadFailAnyExt, WrapE},
|
||||||
@ -6,8 +7,8 @@ pub use super::{
|
|||||||
local::LocalFunctor,
|
local::LocalFunctor,
|
||||||
shared::{SharedFunctor, SharedFunctorAny},
|
shared::{SharedFunctor, SharedFunctorAny},
|
||||||
weakfunctorany::WeakFunctorAny,
|
weakfunctorany::WeakFunctorAny,
|
||||||
Applicative, ApplicativeLA2, ApplicativeSelect, ApplicativeSelectExt, ApplicativeSeq,
|
Applicative, ApplicativeLA2, ApplicativeSeq, ApplicativeTuple, Functor, Monad, Pure,
|
||||||
ApplicativeTuple, Functor, Monad, Pure, Selected, SelectedWrapped, WeakFunctor, Wrap,
|
WeakFunctor, Wrap,
|
||||||
};
|
};
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub use super::{test_suite, tests};
|
pub use super::{test_suite, tests};
|
||||||
|
@ -20,3 +20,5 @@ pub trait MonadExt<'a>: Monad<'a> {
|
|||||||
Self::join(Self::la2(fa, fb, f))
|
Self::join(Self::la2(fa, fb, f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, T: Monad<'a>> MonadExt<'a> for T {}
|
||||||
|
Loading…
Reference in New Issue
Block a user