Noun.Order (Anoma v0.30.0)

I am the module implementing noun ordering functionality.

In particular, I implement functions such as dor/2, gor/2 and mor/2 that provide a notion of partial ordering between nouns.

Summary

Functions

I am the dor function. I provide a partial ordeirng on bear nouns.

I am the gor function. I provide fast partial ordering on mugged nouns.

I am the mor function. I provide fast partial ordering on doubly-mugged nouns.

Functions

@spec dor(Noun.t(), Noun.t()) :: bool()

I am the dor function. I provide a partial ordeirng on bear nouns.

When both nouns are atoms, I check whether the first is less than or equal than the second.

If both are cells, I recurse on the heads unless they are the same. Otherwise I recurse on the tails.

Otherwise, I consider the cell the greater noun.

@spec gor(Noun.t(), Noun.t()) :: bool()

I am the gor function. I provide fast partial ordering on mugged nouns.

@spec mor(Noun.t(), Noun.t()) :: bool()

I am the mor function. I provide fast partial ordering on doubly-mugged nouns.