# Order

> **Order**<`A`> = (`self`, `that`) => `number`

Defined in: [packages/heap/src/order.ts:11](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/heap/src/order.ts#L11)

A total ordering on values of type `A`: a negative number when `self < that`, `0` when they are equivalent, and a positive number when `self > that`. Inspired by [Effect’s Order](https://effect-ts.github.io/effect/effect/Order.ts.html).

The type parameter is contravariant: an `Order<Supertype>` is usable wherever an `Order<Subtype>` is expected (it only reads its arguments), never the other way around.

## Type Parameters

### A

`A`

## Parameters

### self

`A`

### that

`A`

## Returns

`number`
