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
// Add other crate-level attributes if needed, e.g.:
// Enforce documentation for all public items
// Module declarations
/// Provides the HKT `Applicative` trait and its implementations.
/// Provides the HKT `Apply` trait (an extension of `Functor`) and its implementations.
/// Defines `CFn` and `CFnOnce` for heap-allocated, callable function wrappers.
/// Provides the HKT `Functor` trait and its implementations.
/// Defines the `Identity` monad and its HKT marker.
// Added
/// Core infrastructure for Higher-Kinded Types (HKTs), including `HKT` and `HKT1` traits,
/// and various HKT marker types (e.g., `OptionHKTMarker`).
// No longer cfg-gated
/// Provides the HKT `Monad` and `Bind` traits and their implementations.
/// Implements `Profunctor`, `Strong`, and `Choice` traits, primarily for function types.
/// Contains monad transformers like `ReaderT`.
/// Utility functions and macros, including `fn0!`, `fn1!`, etc.
/// Contains legacy (non-HKT, associated type-based) implementations of functional traits.
/// This module is only available when the `legacy` feature is enabled.
// Added legacy module
// Public re-exports of core traits (now default to HKT versions)
pub use Applicative;
pub use Apply;
pub use Functor;
pub use ; // Assuming HKT Monad will be re-exported from monad.rs
pub use ;
pub use MonadReader; // Added
// Public re-exports of key structs/types (optional, but can be convenient)
pub use ;
pub use Identity; // This now points to HKT Identity
pub use ; // This now points to HKT ReaderT and Reader alias
// Re-export HKT markers by default
pub use ;
pub use crateIdentityHKTMarker;
pub use crateReaderTHKTMarker;
// Note: ReaderTHKTMarker was not previously re-exported, adding it.
// Reader alias is now re-exported above.
// Note on macros:
// Macros defined with `#[macro_export]` in submodules (like `utils.rs`) are
// automatically available at the crate root.
// So, `use monadify::fn0;` etc., should work without explicit re-export here.
// If they were not `#[macro_export]`, they would need to be re-exported like:
// pub use utils::fn0; // (if fn0 was not #[macro_export])
// Example of how to conditionally compile and export:
// #[cfg(feature = "experimental")]
// pub use experimental_apply::ExperimentalApply;