Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceErrors

ErrorsLogic · rule

type.ordering_operand

On this page

A comparison such as < or > is used on a value that has no order, such as text or a value that may be none.

Area 3, Logic; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

<, <=, > and >= put two values in order, so they work only where an order means something: numbers and time values of one named type. A value that may be none has no place in an order, and Jadpo won't guess whether none comes first or last. Text has no order either, because the order depends on the reader's language.

What it looks like

main.jadpo:

example
type Count = Int {}type Flag = Bool {}function over_maximum(count: Count?, maximum: Count) -> Flag {    return Flag(count > maximum)}
jadpo checkcheck failed: 1 error, 1 file

error count may be none, so it can't be ordered

--> main.jadpo:6:17

  |6 |     return Flag(count > maximum)  |                 ^^^^^ may be `none`
reason
count is Count?; <, <=, > and >= order two values, and none has no place in an order.
next
Match on count and compare inside some(...) (agent)
rule
type.ordering_operand
help
https://jadpo.dev/docs/errors/type.ordering_operand

(agent) at the end of the next: line means your coding agent can make the fix itself.

Comparing two pieces of text with < is the same error:

main.jadpo:

example
type Name = Text {}type Flag = Bool {}function earlier(name: Name, other: Name) -> Flag {    return Flag(name < other)}
jadpo checkcheck failed: 1 error, 1 file

error Name has no order

--> main.jadpo:6:17

  |6 |     return Flag(name < other)  |                 ^^^^ this is `Name`
reason
Text order depends on the reader's language, so <, <=, > and >= work only on numbers and time values.
next
Compare the text with ==, or order it with a standard-library function (agent)
rule
type.ordering_operand
help
https://jadpo.dev/docs/errors/type.ordering_operand

How to fix it

If the value may be none, match on it, compare inside some(...), and say what the answer is when there is no value:

example
    return match count {        some(known) -> Flag(known > maximum)        none -> false    }

A count that is there is compared with the maximum, and a missing count is never over it.

If you are putting text in order, sort a list of it with list.sort_by, giving the text as the key. main.jadpo becomes:

example
type Name = Text {}function in_order(names: List<Name>) -> List<Name> {    return list.sort_by(names, name -> name)}

The names come back sorted by their code points, the same order a query sorts text in. Given locale:, list.sort_by orders text by a language's rules instead (Lists). To check that two pieces of text are the same, compare them with ==.

Markdown for agents: /docs/errors/type.ordering_operand.md.Built from Jadpo main at aee2e8f.