Skip to content

Commit

Permalink
documentation: use signature instead of declaration for all conte…
Browse files Browse the repository at this point in the history
…xt definitions
  • Loading branch information
daht-x committed Dec 9, 2024
1 parent af3f1e0 commit bbb8b4a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 61 deletions.
26 changes: 13 additions & 13 deletions libraries/core/documentation/monads/result-factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Type intended to expose a set of ways to initialize [`Result<TFailure, TSuccess>

#### `Fail<TFailure, TSuccess>(failure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Fail<TFailure, TSuccess>(TFailure failure)
Expand All @@ -54,7 +54,7 @@ Type intended to expose a set of ways to initialize [`Result<TFailure, TSuccess>

#### `Fail<TFailure, TSuccess>(createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Fail<TFailure, TSuccess>(Func<TFailure> createFailure)
Expand All @@ -78,7 +78,7 @@ Type intended to expose a set of ways to initialize [`Result<TFailure, TSuccess>

#### `Succeed<TFailure, TSuccess>(success)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Succeed<TFailure, TSuccess>(TSuccess success)
Expand All @@ -102,7 +102,7 @@ Type intended to expose a set of ways to initialize [`Result<TFailure, TSuccess>

#### `Succeed<TFailure, TSuccess>(createSuccess)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Succeed<TFailure, TSuccess>(Func<TSuccess> createSuccess)
Expand All @@ -126,7 +126,7 @@ Type intended to expose a set of ways to initialize [`Result<TFailure, TSuccess>

#### `Catch<TException, TFailure, TSuccess>(createSuccess, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Catch<TException, TFailure, TSuccess>(Func<TSuccess> createSuccess, Func<TException, TFailure> createFailure)
Expand Down Expand Up @@ -154,7 +154,7 @@ successful result.

#### `Ensure<TFailure, TSuccess>(success, predicate, failure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TFailure, TSuccess>(TSuccess success, Func<TSuccess, bool> predicate, TFailure failure)
Expand All @@ -180,7 +180,7 @@ successful result.

#### `Ensure<TFailure, TSuccess>(success, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TFailure, TSuccess>(TSuccess success, Func<TSuccess, bool> predicate, Func<TSuccess, TFailure> createFailure)
Expand All @@ -206,7 +206,7 @@ successful result.

#### `Ensure<TFailure, TSuccess>(createSuccess, predicate, failure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TFailure, TSuccess>(Func<TSuccess> createSuccess, Func<TSuccess, bool> predicate, TFailure failure)
Expand All @@ -232,7 +232,7 @@ successful result.

#### `Ensure<TFailure, TSuccess>(createSuccess, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TFailure, TSuccess>(Func<TSuccess> createSuccess, Func<TSuccess, bool> predicate, Func<TSuccess, TFailure> createFailure)
Expand All @@ -258,7 +258,7 @@ successful result.

#### `Ensure<TAuxiliary, TFailure, TSuccess>(success, auxiliary, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TAuxiliary, TFailure, TSuccess>(TSuccess success, TAuxiliary auxiliary, Func<TSuccess, TAuxiliary, bool> predicate, Func<TSuccess, TAuxiliary, TFailure> createFailure)
Expand Down Expand Up @@ -286,7 +286,7 @@ successful result.

#### `Ensure<TAuxiliary, TFailure, TSuccess>(success, createAuxiliary, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TAuxiliary, TFailure, TSuccess>(TSuccess success, Func<TAuxiliary> createAuxiliary, Func<TSuccess, TAuxiliary, bool> predicate, Func<TSuccess, TAuxiliary, TFailure> createFailure)
Expand Down Expand Up @@ -314,7 +314,7 @@ successful result.

#### `Ensure<TAuxiliary, TFailure, TSuccess>(createSuccess, auxiliary, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TAuxiliary, TFailure, TSuccess>(Func<TSuccess> createSuccess, TAuxiliary auxiliary, Func<TSuccess, TAuxiliary, bool> predicate, Func<TSuccess, TAuxiliary, TFailure> createFailure)
Expand Down Expand Up @@ -342,7 +342,7 @@ successful result.

#### `Ensure<TAuxiliary, TFailure, TSuccess>(createSuccess, createAuxiliary, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public static Result<TFailure, TSuccess> Ensure<TAuxiliary, TFailure, TSuccess>(Func<TSuccess> createSuccess, Func<TAuxiliary> createAuxiliary, Func<TSuccess, TAuxiliary, bool> predicate, Func<TSuccess, TAuxiliary, TFailure> createFailure)
Expand Down
80 changes: 33 additions & 47 deletions libraries/core/documentation/monads/result.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ Type intended to handle both the possible failure and the expected success of a
- [`Ensure(predicate, createFailure)`](#ensurepredicate-createfailure)
- [`Ensure<TAuxiliary>(auxiliary, predicate, createFailure)`](#ensuretauxiliaryauxiliary-predicate-createfailure)
- [`Ensure<TAuxiliary>(createAuxiliary, predicate, createFailure)`](#ensuretauxiliarycreateauxiliary-predicate-createfailure)
- [`DoOnFailure(Action execute)`](#doonfailureaction-execute)
- [`DoOnFailure(Action<TFailure> execute)`](#doonfailureactiontfailure-execute)
- [`DoOnFailure(execute)`](#doonfailureexecute)
- [`DoOnSuccess(execute)`](#doonsuccessexecute)
- [`Map<TSuccessToMap>(successToMap)`](#maptsuccesstomapsuccesstomap)
- [`Map<TSuccessToMap>(createSuccessToMap)`](#maptsuccesstomapcreatesuccesstomap)
Expand Down Expand Up @@ -64,7 +63,7 @@ Type of expected success.

#### `IsFailed`

- Declaration
- Signature

```cs
public bool IsFailed { get; }
Expand All @@ -76,7 +75,7 @@ Type of expected success.

#### `Failure`

- Declaration
- Signature

```cs
public TFailure Failure { get; }
Expand All @@ -88,7 +87,7 @@ Type of expected success.

#### `IsSuccessful`

- Declaration
- Signature

```cs
public bool IsSuccessful { get; }
Expand All @@ -100,7 +99,7 @@ Type of expected success.

#### `Success`

- Declaration
- Signature

```cs
public TSuccess Success { get; }
Expand All @@ -114,7 +113,7 @@ Type of expected success.

#### `Result(failure)`

- Declaration:
- Signature:

```cs
public Result(TFailure failure)
Expand All @@ -131,7 +130,7 @@ Type of expected success.

#### `Result(success)`

- Declaration:
- Signature:

```cs
public Result(TSuccess success)
Expand All @@ -150,7 +149,7 @@ Type of expected success.

#### `==(left, right)`

- Declaration:
- Signature:

```cs
public static bool operator ==(Result<TFailure, TSuccess>? left, Result<TFailure, TSuccess>? right)
Expand All @@ -168,7 +167,7 @@ Type of expected success.

#### `!=(left, right)`

- Declaration:
- Signature:

```cs
public static bool operator !=(Result<TFailure, TSuccess>? left, Result<TFailure, TSuccess>? right)
Expand All @@ -188,7 +187,7 @@ Type of expected success.

#### `Result<TFailure, TSuccess>(failure)`

- Declaration:
- Signature:

```cs
public static implicit operator Result<TFailure, TSuccess>(TFailure failure)
Expand All @@ -205,7 +204,7 @@ Type of expected success.

#### `Result<TFailure, TSuccess>(success)`

- Declaration:
- Signature:

```cs
public static implicit operator Result<TFailure, TSuccess>(TSuccess success)
Expand All @@ -224,7 +223,7 @@ Type of expected success.

#### `Catch<TException>(execute, createFailure)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> Catch<TException>(Action<TSuccess> execute, Func<TException, TFailure> createFailure)
Expand All @@ -249,7 +248,7 @@ Type of expected success.

#### `Catch<TException>(createSuccess, createFailure)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> Catch<TException>(Func<TSuccess, TSuccess> createSuccess, Func<TException, TFailure> createFailure)
Expand All @@ -275,7 +274,7 @@ successful result.

#### `Ensure(predicate, failure)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> Ensure(Func<TSuccess, bool> predicate, TFailure failure)
Expand All @@ -293,7 +292,7 @@ successful result.

#### `Ensure(predicate, createFailure)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> Ensure(Func<TSuccess, bool> predicate, Func<TSuccess, TFailure> createFailure)
Expand All @@ -311,7 +310,7 @@ successful result.

#### `Ensure<TAuxiliary>(auxiliary, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> Ensure<TAuxiliary>(TAuxiliary auxiliary, Func<TSuccess, TAuxiliary, bool> predicate, Func<TSuccess, TAuxiliary, TFailure> createFailure)
Expand All @@ -336,7 +335,7 @@ successful result.

#### `Ensure<TAuxiliary>(createAuxiliary, predicate, createFailure)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> Ensure<TAuxiliary>(Func<TAuxiliary> createAuxiliary, Func<TSuccess, TAuxiliary, bool> predicate, Func<TSuccess, TAuxiliary, TFailure> createFailure)
Expand All @@ -359,30 +358,17 @@ successful result.

***[Top](#resulttfailure-tsuccess)***

#### `DoOnFailure(Action execute)`
#### `DoOnFailure(execute)`

- Declaration:
- Signatures:

```cs
public Result<TFailure, TSuccess> DoOnFailure(Action execute)
```

- Description: Executes an action if the previous result is failed.
- Parameters:
- ```cs
public Result<TFailure, TSuccess> DoOnFailure(Action execute)
```

| Name | Description |
|:----------|:----------------------|
| `execute` | The action to execute |

***[Top](#resulttfailure-tsuccess)***

#### `DoOnFailure(Action<TFailure> execute)`

- Declaration:

```cs
public Result<TFailure, TSuccess> DoOnFailure(Action<TFailure> execute)
```
- ```cs
public Result<TFailure, TSuccess> DoOnFailure(Action<TFailure> execute)
```

- Description: Executes an action if the previous result is failed.
- Parameters:
Expand All @@ -395,7 +381,7 @@ successful result.

#### `DoOnSuccess(execute)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccess> DoOnSuccess(Action<TSuccess> execute)
Expand All @@ -412,7 +398,7 @@ successful result.

#### `Map<TSuccessToMap>(successToMap)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccessToMap> Map<TSuccessToMap>(TSuccessToMap successToMap)
Expand All @@ -435,7 +421,7 @@ successful result.

#### `Map<TSuccessToMap>(createSuccessToMap)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccessToMap> Map<TSuccessToMap>(Func<TSuccess, TSuccessToMap> createSuccessToMap)
Expand All @@ -458,7 +444,7 @@ successful result.

#### `Bind<TSuccessToBind>(createResultToBind)`

- Declaration:
- Signature:

```cs
public Result<TFailure, TSuccessToBind> Bind<TSuccessToBind>(Func<TSuccess, Result<TFailure, TSuccessToBind>> createResultToBind)
Expand All @@ -481,7 +467,7 @@ successful result.

#### `Reduce<TReducer>(reduceFailure, reduceSuccess)`

- Declaration:
- Signature:

```cs
public TReducer Reduce<TReducer>(Func<TFailure, TReducer> reduceFailure, Func<TSuccess, TReducer> reduceSuccess)
Expand All @@ -505,7 +491,7 @@ successful result.

#### `Equals(obj)`

- Declaration:
- Signature:

```cs
public override bool Equals(object? obj)
Expand All @@ -522,7 +508,7 @@ successful result.

#### `Equals(other)`

- Declaration:
- Signature:

```cs
public bool Equals(Result<TFailure, TSuccess>? other)
Expand All @@ -539,7 +525,7 @@ successful result.

#### `GetHashCode()`

- Declaration:
- Signature:

```cs
public override int GetHashCode()
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/documentation/unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type).

#### `Discarder`

- Declaration
- Signature

```cs
public static Unit Discarder { get; }
Expand Down

0 comments on commit bbb8b4a

Please sign in to comment.