-
Notifications
You must be signed in to change notification settings - Fork 15
Fill in the Doxygen stanzas across include/fn and include/pfn #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
328b838
Fill in the Doxygen stanzas across include/fn
Bronek f7ed2a2
Extend the docs site over the new stanzas
Bronek cdfe6b4
Fill in the Doxygen stanzas across include/pfn
Bronek a0aaf76
Add the pfn chapter to the docs site
Bronek ef11dab
Correct the Defined-in coverage on two docs pages
Bronek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| title: Composition | ||
| --- | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <fn/pack.hpp>"} | ||
|
|
||
| --- | ||
|
|
||
| Independent computations compose side by side. The conjunction `a & b` keeps both results: | ||
| values multiply into a `pack` and errors sum into a `copack`, with the leftmost failing operand's | ||
| error held at runtime. The disjunction `a | b` keeps the first that worked: values sum into a | ||
| `copack` and errors multiply into a `pack`, present only when every operand failed. Each | ||
| carrier's header declares its own `&` and `|` operators; this header defines their n-ary folds | ||
| `fn::conjoin` and `fn::disjoin`. | ||
|
|
||
| ## conjoin {style: "api"} | ||
| :include-doxygen-doc: fn::conjoin_t | ||
|
|
||
| ## conjoin call signatures {style: "api"} | ||
| :include-doxygen-member: fn::conjoin_t::operator() { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ## disjoin {style: "api"} | ||
| :include-doxygen-doc: fn::disjoin_t | ||
|
|
||
| ## disjoin call signatures {style: "api"} | ||
| :include-doxygen-member: fn::disjoin_t::operator() { signatureOnly: false, includeAllMatches: true } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| title: Expected monad | ||
| --- | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <fn/expected.hpp>"} | ||
|
|
||
| --- | ||
|
|
||
| :include-doxygen-doc: fn::expected | ||
|
|
||
| ## expected_unit {style: "api"} | ||
| The graded gateway: initiating a pipeline with this unit trigger opts all subsequent `and_then` | ||
| steps into graded error-set unioning, with no fake starting errors. | ||
|
|
||
| :include-doxygen-member: fn::expected_unit { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ## copack_error {style: "api"} | ||
| The explicit lift into the graded world, on the error side. | ||
|
|
||
| :include-doxygen-member: fn::expected::copack_error { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ## copack_value {style: "api"} | ||
| The same lift, on the value side. | ||
|
|
||
| :include-doxygen-member: fn::expected::copack_value { signatureOnly: false, includeAllMatches: true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| title: Multidispatch | ||
| --- | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <fn/functional.hpp>"} | ||
|
Bronek marked this conversation as resolved.
|
||
|
|
||
| --- | ||
|
|
||
| Elimination of the algebraic structures: `fn::apply` unpacks products and dispatches over | ||
| alternatives by ordinary C++ overload resolution, and `fn::overload` fuses per-alternative | ||
| lambdas into one overload set. Dispatch is exhaustive: an alternative without a viable arm makes | ||
| the whole call not applicable. | ||
|
|
||
| ## apply {style: "api"} | ||
| :include-doxygen-member: fn::apply { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ## apply_r {style: "api"} | ||
| :include-doxygen-member: fn::apply_r { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ## overload {style: "api"} | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <fn/utility.hpp>"} | ||
|
|
||
| :include-doxygen-doc: fn::overload | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| title: Optional monad | ||
| --- | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <fn/optional.hpp>"} | ||
|
|
||
| --- | ||
|
|
||
| :include-doxygen-doc: fn::optional | ||
|
|
||
| ## copack_value {style: "api"} | ||
| The explicit lift into the graded world. | ||
|
|
||
| :include-doxygen-member: fn::optional::copack_value { signatureOnly: false, includeAllMatches: true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| title: Expected polyfill | ||
| --- | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <pfn/expected.hpp>"} | ||
|
|
||
| --- | ||
|
|
||
| :include-doxygen-doc: pfn::expected | ||
|
|
||
| ## expected over void {style: "api"} | ||
| The partial specialization serving computations which succeed with no value. | ||
|
|
||
| :include-doxygen-doc: pfn::expected< void, E > | ||
|
|
||
| ## unexpected {style: "api"} | ||
|
|
||
| :include-doxygen-doc: pfn::unexpected | ||
|
|
||
| ## unexpect {style: "api"} | ||
|
|
||
| :include-doxygen-doc: pfn::unexpect_t | ||
|
|
||
| ## bad_expected_access {style: "api"} | ||
|
|
||
| :include-doxygen-doc: pfn::bad_expected_access | ||
|
|
||
| :include-doxygen-doc: pfn::bad_expected_access< void > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| title: Polyfill layer | ||
| --- | ||
|
|
||
| The library is layered: namespace `pfn` is a faithful polyfill of standard vocabulary types and | ||
| utilities as specified for C++26, available to a C++20 compiler, and namespace `fn` builds the | ||
| functional-programming extensions on top of it. Every `fn` type with a `pfn` counterpart is a | ||
| strict superset of it: a valid program switching from `pfn` to `fn` changes neither compilation | ||
| nor behaviour. | ||
|
|
||
| `pfn` polyfills only what C++20 lacks: all of `<expected>`, the C++23 and C++26 additions to | ||
| `std::optional` (the monadic operations, iterator support, `optional<T&>`), `std::apply` in its | ||
| SFINAE-friendly C++26 shape together with its applicability traits, `std::invoke_r` and | ||
| `std::unreachable`. Names C++20 already has — `std::nullopt`, `std::in_place`, | ||
| `std::bad_optional_access` — are used directly and not mirrored. | ||
|
|
||
| The polyfills track the C++ working draft, deviating deliberately in three ways, each noted on | ||
| the entity it concerns: | ||
|
|
||
| * where the standard leaves a member's `noexcept` specification unstated, one is derived from | ||
| the underlying types; every such clause is marked `// extension` in the source | ||
| * the draft's hardened preconditions are checked with an assertion, customizable by defining | ||
| `LIBFN_ASSERT` before inclusion | ||
| * `expected`'s comparison against a value is declared at namespace scope rather than as a | ||
| hidden friend, keeping its constraint deducible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| title: Optional polyfill | ||
| --- | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <pfn/optional.hpp>"} | ||
|
|
||
| --- | ||
|
|
||
| :include-doxygen-doc: pfn::optional | ||
|
|
||
| ## optional over a reference {style: "api"} | ||
|
|
||
| :include-doxygen-doc: pfn::optional< T & > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| title: Utilities | ||
| --- | ||
|
|
||
| ## apply {style: "api"} | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <pfn/tuple.hpp>"} | ||
|
|
||
| :include-doxygen-member: pfn::apply { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ### Applicability traits {style: "api"} | ||
| The C++26 traits `apply` is specified through; each also comes in its `_v` (for the two | ||
| predicates) or `_t` (for the result) form. | ||
|
|
||
| :include-doxygen-doc: pfn::is_applicable | ||
|
|
||
| :include-doxygen-doc: pfn::is_nothrow_applicable | ||
|
|
||
| :include-doxygen-doc: pfn::apply_result | ||
|
|
||
| ## invoke_r {style: "api"} | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <pfn/functional.hpp>"} | ||
|
|
||
| :include-doxygen-member: pfn::invoke_r { signatureOnly: false, includeAllMatches: true } | ||
|
|
||
| ## unreachable {style: "api"} | ||
|
|
||
| ##### Defined in {style: "api", badge: "#include <pfn/utility.hpp>"} | ||
|
|
||
| :include-doxygen-member: pfn::unreachable { signatureOnly: false, includeAllMatches: true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.