Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/packages/quant/core/contract/Comparable.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface Comparable
#[Getter]
class Money implements Comparable {

use AccessorTrait;

public function __construct(
private int $amount,
private int $cents
Expand Down Expand Up @@ -51,7 +53,7 @@ class Money implements Comparable {

## Remarks

This interface implements a total order on `<T>` for objects of `<T>`, with `<T>` being a subtype of `Comparable`. It provides a method `compareTo` whose implementation must, for all $a, b \in T$, conform to
This interface implements a total order on `T` for objects of `T`, with `T` being a subtype of `Comparable`. It provides a method `compareTo` whose implementation must, for all $a, b \in T$, conform to
- $(a \in T) \space \lt \space (b \in T) :\iff a$`->`$compareTo(b) = -1$
- $(a \in T) \space = \space (b \in T) :\iff a$`->`$compareTo(b) = 0$
- $(a \in T) \space \gt \space (b \in T) :\iff a$`->`$compareTo(b) = 1$
Expand Down
3 changes: 2 additions & 1 deletion docs/packages/quant/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Low-level API providing contracts, base classes and commonly-used functionality.
|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [AccessorTrait](/docs/packages/quant/core/trait/accessortrait) | Provides accessor automation for object properties attributed with `#[Setter]` and/or `#[Getter]`. |
| [Arrayable](/docs/packages/quant/core/contract/arrayable) | Indicates the availability of an array-representative for the implementing class' instance. |
| [Equatable](/docs/packages/quant/core/contract/equatable) | Implements an equivalence relation for objects |
| [Comparable](/docs/packages/quant/core/contract/comparable) | Implements a total order on objects of `T : Comparable`. |
| [Equatable](/docs/packages/quant/core/contract/equatable) | Implements an equivalence relation for objects of `T : Equatable` |


## Benchmarks
Expand Down
8 changes: 5 additions & 3 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ const sidebars = {
type: 'category',
label: 'Core',
link: {type: 'doc', id: "packages/quant/core/quant_core"},
items: [{
items: [
{
type: 'category',
label: 'Contract',
items: [
"packages/quant/core/contract/arrayable",
items: [
"packages/quant/core/contract/arrayable",
"packages/quant/core/contract/comparable",
"packages/quant/core/contract/equatable"
]
}, {
Expand Down