A tiny Elixir library for piping values that match ok/error tuples or custom patterns.
Ok Jose is a lightweight Elixir library that simplifies working with tagged tuples like `{:ok, _}` and `{:error, _}` in pipelines. It provides macros to create 'happy pipes' that automatically handle success/error flows without interrupting the pipe chain, making code more readable and maintainable.
Elixir developers who frequently use tagged tuples for error handling in pipelines and want to reduce boilerplate code. It's particularly useful for those integrating with Erlang libraries or following similar conventions in their own codebases.
Developers choose Ok Jose because it integrates seamlessly with plain Elixir piping syntax, requiring no new syntax to learn, and allows custom pipe definitions for domain-specific patterns. It reduces verbosity compared to manual case matching while maintaining the expressiveness of Elixir's tagged tuple conventions.
Pipe elixir functions that match ok/error tuples or custom patterns.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically unwraps values from tagged tuples like `{:ok, _}`, eliminating verbose case statements as demonstrated in the README's File.read example.
Enables creation of domain-specific pipes using `defpipe`, such as handling both `{:ok, _}` tuples and valid Ecto changesets, for tailored pipeline logic.
Provides `if/2` and `cond/2` macros to incorporate predicates and complex conditions directly into pipes, enhancing expressiveness without breaking the chain.
Works with standard Elixir piping syntax, requiring no new operators or syntax, which lowers the adoption barrier for Elixir developers.
Heavy reliance on macros can obscure runtime behavior and make debugging more challenging, especially for teams less experienced with Elixir metaprogramming.
The README includes a badge seeking a maintainer, indicating potential risks for future updates, bug fixes, and compatibility with new Elixir versions.
Since Elixir 1.2 introduced the `with` form, some of Ok Jose's use cases are covered by standard language features, reducing its necessity in modern codebases.