A library providing common algebraic and categorical abstractions like monoids, functors, and monads to Elixir.
Witchcraft is an Elixir library that provides common algebraic and categorical abstractions, such as monoids, functors, monads, arrows, and categories. It solves the problem of bringing principled functional programming patterns to Elixir, enabling more declarative and composable code while staying true to the language's idioms.
Elixir developers interested in functional programming patterns, especially those familiar with concepts from Haskell, Scala, or Fantasy Land who want to apply them in Elixir projects.
Developers choose Witchcraft because it offers a clean, idiomatic implementation of functional abstractions tailored for Elixir, with beginner-friendly documentation, seamless integration into existing codebases, and a focus on practicality without sacrificing mathematical rigor.
Monads and other dark magic for Elixir
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements a full type class hierarchy including Semigroup, Monoid, Functor, and Monad, enabling principled functional programming in Elixir as detailed in the README's type class chart.
Honors Elixir's pipe-first data flow and expands standard operators like `<>` to work on any monoid, ensuring seamless integration with the language's conventions.
Provides clear examples via doctests and avoids requiring knowledge of other languages, making advanced concepts accessible to Elixir developers.
Compatible with regular Elixir code without enforcing strict types, allowing incremental integration into existing projects as emphasized in the pragmatism section.
Uses TypeClass to enforce type class properties at compile time, ensuring custom instances adhere to mathematical laws and reducing runtime errors.
Overrides core Elixir operators like `<>` and `~>`, which can cause conflicts or unexpected behavior in mixed codebases, despite the option to disable overrides.
Requires familiarity with algebraic abstractions like monads and categories, posing a barrier for developers new to functional programming paradigms.
Relies on a family of libraries (Quark, TypeClass, Algae) for full functionality, adding to dependency management and potential versioning issues.
While documentation includes doctests, practical, large-scale use cases are less prevalent compared to more established Elixir libraries, making adoption cautious.