Expand description
§Project Structure
§Module Dependency Graph
---
config:
layout: elk
---
graph TD
fp-macros["fp-macros<br/>(proc macro crate)"]
kinds["kinds<br/>Kind + InferableBrand traits"]
brands["brands<br/>Brand marker types"]
classes["classes<br/>Type class traits"]
dispatch["dispatch<br/>Val/Ref routing"]
functions["functions<br/>Inference wrappers"]
types["types<br/>Concrete implementations"]
fp-macros -.->|"used by all modules"| kinds
kinds --> brands
kinds --> classes
classes --> dispatch
kinds --> dispatch
classes --> types
kinds --> types
brands --> types
dispatch --> functions
kinds --> functionsSolid arrows show intra-crate use dependencies. The dashed arrow shows
the proc macro crate boundary (fp-macros is a separate crate used at
compile time by all fp-library modules).
§Modules
- fp-macros: Procedural macros for HKT traits (
trait_kind!,impl_kind!,Apply!), do-notation (m_do!,a_do!), brand inference (InferableBrand!), and documentation generation (#[document_module],#[document_signature], etc.). - kinds:
KindandInferableBrandtrait definitions generated bytrait_kind!. Provides type application machinery mapping brands to concrete types and back. - brands: Zero-sized brand marker types (e.g.,
OptionBrand,VecBrand) that represent unapplied type constructors. Leaf nodes in the dependency graph with no outgoing edges. - classes: Type class trait definitions (
Functor,Monad,Foldable, etc.) and their by-reference counterparts (RefFunctor,RefSemimonad, etc.). Each trait module also defines free function wrappers used by theexplicitsub-module. - dispatch: Val/Ref dispatch traits, inference wrapper functions, and explicit dispatch functions. Each module (e.g.,
dispatch/functor.rs) contains the dispatch trait with Val/Ref impls, the inference wrapper that combines brand inference (viaInferableBrand) with dispatch, and amod explicitsubmodule with the brand-explicit variant. - functions: Facade module (
functions.rs) that re-exports inference wrappers fromdispatch/as bare names (map,bind, etc.) and explicit variants in theexplicitsub-module. No source files infunctions/. - types: Concrete type implementations of type classes. Contains both custom types (
Identity,Lazy,CatList,Coyoneda) and implementations for standard library types (Option,Vec,Result).