Entries in italics are supertypes of existing types, for convenience.

## Literals & Entities

** ==** :

`Entity -> Entity -> Boolean`

Entity equality.

** /=** :

`Entity -> Entity -> Boolean`

Entity non-equality.

** entityAnchor** :

`Entity -> Text`

The anchor of an entity, as text.

** id** :

`Literal -> Entity`

Every literal is an entity.

** toText** :

`Literal -> Text`

The text of a literal.

### Boolean

** id** :

`Boolean -> Literal`

Every boolean is a literal.

** True** :

`Boolean`

(also pattern)Boolean TRUE.

** False** :

`Boolean`

(also pattern)Boolean FALSE.

** &&** :

`Boolean -> Boolean -> Boolean`

Boolean AND.

** ||** :

`Boolean -> Boolean -> Boolean`

Boolean OR.

** not** :

`Boolean -> Boolean`

Boolean NOT.

### Text

** id** :

`Text -> Literal`

Every text is a literal.

** <>** :

`Text -> Text -> Text`

Concatenate text.

** textLength** :

`Text -> Integer`

The length of a piece of text.

** textSection** :

`Integer -> Integer -> Text -> Text`

`textSection start len text`

is the section of `text`

beginning at `start`

of length `len`

.** textConcat** :

`[Text] -> Text`

Concatenate texts.

### Numeric

** ~==** :

`Number -> Number -> Boolean`

Numeric equality, folding exact and inexact numbers.

** ~/=** :

`Number -> Number -> Boolean`

Numeric non-equality.

** <** :

`Number -> Number -> Boolean`

Numeric strictly less.

** <=** :

`Number -> Number -> Boolean`

Numeric less or equal.

** >** :

`Number -> Number -> Boolean`

Numeric strictly greater.

** >=** :

`Number -> Number -> Boolean`

Numeric greater or equal.

#### Integer

** id** :

`Integer -> Rational`

Every integer is a rational.

** parseInteger** :

`Text -> Maybe Integer`

Parse text as an integer.

** interpretIntegerAsText** :

`Ref Integer -> Ref Text`

Interpret an integer reference as text.

** +** :

`Integer -> Integer -> Integer`

Add.

** -** :

`Integer -> Integer -> Integer`

Subtract.

** *** :

`Integer -> Integer -> Integer`

Multiply.

** negate** :

`Integer -> Integer`

Negate.

** abs** :

`Integer -> Integer`

Absolute value.

** signum** :

`Integer -> Integer`

Sign.

** mod** :

`Integer -> Integer -> Integer`

Modulus, leftover from

`div`

** even** :

`Integer -> Boolean`

Is even?

** odd** :

`Integer -> Boolean`

Is odd?

** gcd** :

`Integer -> Integer -> Integer`

Greatest common divisor.

** lcm** :

`Integer -> Integer -> Integer`

Least common multiple.

** ^** :

`Integer -> Integer -> Integer`

Raise to non-negative power.

** sum** :

`[Integer] -> Integer`

Sum.

** product** :

`[Integer] -> Integer`

Product.

#### Rational

** id** :

`Rational -> Number`

Every rational is a number.

** parseRational** :

`Text -> Maybe Rational`

Parse text as a rational.

** interpretRationalAsText** :

`Ref Rational -> Ref Text`

Interpret a rational reference as text.

** .+** :

`Rational -> Rational -> Rational`

Add.

** .-** :

`Rational -> Rational -> Rational`

Subtract.

** .*** :

`Rational -> Rational -> Rational`

Multiply.

** /** :

`Rational -> Rational -> Rational`

Divide.

** negateR** :

`Rational -> Rational`

Negate.

** recip** :

`Rational -> Rational`

Reciprocal.

** absR** :

`Rational -> Rational`

Absolute value.

** signumR** :

`Rational -> Rational`

Sign.

** modR** :

`Rational -> Rational -> Rational`

Modulus, leftover from

`div`

** ^^** :

`Rational -> Integer -> Rational`

Raise to Integer power.

** sumR** :

`[Rational] -> Rational`

Sum.

** meanR** :

`[Rational] -> Rational`

Mean.

** productR** :

`[Rational] -> Rational`

Product.

#### Number

** id** :

`Number -> Literal`

Every number is a literal.

** parseNumber** :

`Text -> Maybe Number`

Parse text as a number.

** interpretNumberAsText** :

`Ref Number -> Ref Text`

Interpret a number reference as text.

** ~+** :

`Number -> Number -> Number`

Add.

** ~-** :

`Number -> Number -> Number`

Subtract.

** ~*** :

`Number -> Number -> Number`

Multiply.

** ~/** :

`Number -> Number -> Number`

Divide.

** negateN** :

`Number -> Number`

Negate.

** recipN** :

`Number -> Number`

Reciprocal.

** pi** :

`Number`

Half the radians in a circle.

** exp** :

`Number -> Number`

Exponent

** log** :

`Number -> Number`

Natural logarithm

** sqrt** :

`Number -> Number`

Square root.

** **** :

`Number -> Number -> Number`

Raise to power.

** logBase** :

`Number -> Number -> Number`

** sin** :

`Number -> Number`

Sine of an angle in radians.

** cos** :

`Number -> Number`

Cosine of an angle in radians.

** tan** :

`Number -> Number`

Tangent of an angle in radians.

** asin** :

`Number -> Number`

Radian angle of a sine.

** acos** :

`Number -> Number`

Radian angle of a cosine.

** atan** :

`Number -> Number`

Radian angle of a tangent.

** sinh** :

`Number -> Number`

Hyperbolic sine.

** cosh** :

`Number -> Number`

Hyperbolic cosine.

** tanh** :

`Number -> Number`

Hyperbolic tangent.

** asinh** :

`Number -> Number`

Inverse hyperbolic sine.

** acosh** :

`Number -> Number`

Inverse hyperbolic cosine.

** atanh** :

`Number -> Number`

Inverse hyperbolic tangent.

** nabs** :

`Number -> Number`

Absolute value.

** signumN** :

`Number -> Number`

Sign. Note this will be the same exact or inexact as the number.

** floor** :

`Number -> Integer`

Integer towards negative infinity.

** ceiling** :

`Number -> Integer`

Integer towards positive infinity.

** round** :

`Number -> Integer`

Closest Integer.

** inexact** :

`Number -> Number`

Convert a number to inexact.

** approximate** :

`Rational -> Number -> Rational`

`approximate d x`

gives the exact number that's a multiple of `d`

that's closest to `x`

.** div** :

`Number -> Number -> Integer`

Division to Integer, towards negative infinity.

** modN** :

`Number -> Number -> Number`

Modulus, leftover from

`div`

** isNaN** :

`Number -> Boolean`

Is not a number?

** isInfinite** :

`Number -> Boolean`

Is infinite?

** isNegativeZero** :

`Number -> Boolean`

Is negative zero?

** isExact** :

`Number -> Boolean`

Is exact?

** sumN** :

`[Number] -> Number`

Sum.

** meanN** :

`[Number] -> Number`

Mean.

** productN** :

`[Number] -> Number`

Product.

** checkExactSafeRational** :

`Number -> Maybe Rational`

Get the exact value of a Number, if it is one.

** checkExactInteger** :

`Number -> Maybe Integer`

Get the exact Integer value of a Number, if it is one. Works as expected on Rationals.

### Date & Time

#### Duration

** id** :

`Duration -> Literal`

Every duration is a literal.

** parseDuration** :

`Text -> Maybe Duration`

Parse text as a duration. Inverse of

`toText`

.** interpretDurationAsText** :

`Ref Duration -> Ref Text`

Interpret a duration reference as text.

** zeroDuration** :

`Duration`

No duration.

** secondsToDuration** :

`Rational -> Duration`

Convert seconds to duration.

** durationToSeconds** :

`Duration -> Rational`

Convert duration to seconds.

** dayDuration** :

`Duration`

One day duration.

** addDuration** :

`Duration -> Duration -> Duration`

Add durations.

** subtractDuration** :

`Duration -> Duration -> Duration`

Subtract durations.

** negateDuration** :

`Duration -> Duration`

Negate duration.

** multiplyDuration** :

`Number -> Duration -> Duration`

Multiply a duration by a number.

** divideDuration** :

`Duration -> Duration -> Number`

Divide durations.

#### Time

Absolute time as measured by UTC.

** id** :

`Time -> Literal`

Every time is a literal.

** parseTime** :

`Text -> Maybe Time`

Parse text as a time. Inverse of

`toText`

.** interpretTimeAsText** :

`Ref Time -> Ref Text`

Interpret a time reference as text.

** addTime** :

`Duration -> Time -> Time`

Add duration to time.

** diffTime** :

`Time -> Time -> Duration`

Difference of times.

** unixFormatTime** :

`Text -> Time -> Text`

Format a time as text, using a UNIX-style formatting string.

** unixParseTime** :

`Text -> Text -> Maybe Time`

Parse text as a time, using a UNIX-style formatting string.

** getTime** :

`Action Time`

Get the current time.

** newClock** :

`Duration -> Action (Ref +Time)`

Make a reference to the current time that updates per the given duration.

#### Calendar

** Date** :

`Integer -> Integer -> Integer -> Date`

(also pattern)Construct a Date from year, month, day.

** id** :

`Date -> Literal`

Every day is a literal.

** parseDate** :

`Text -> Maybe Date`

Parse text as a day.

** interpretDateAsText** :

`Ref Date -> Ref Text`

Interpret a date reference as text.

** dateToModifiedJulian** :

`Date -> Integer`

Convert to MJD.

** modifiedJulianToDate** :

`Integer -> Date`

Convert from MJD.

** addDays** :

`Integer -> Date -> Date`

Add count to days to date.

** diffDays** :

`Date -> Date -> Integer`

Difference of days between dates.

** unixFormatDate** :

`Text -> Date -> Text`

Format a date as text, using a UNIX-style formatting string.

** unixParseDate** :

`Text -> Text -> Maybe Date`

Parse text as a date, using a UNIX-style formatting string.

** getUTCDate** :

`Action Date`

Get the current UTC date.

** getDate** :

`Action Date`

Get the current local date.

#### Time of Day

** TimeOfDay** :

`Integer -> Integer -> Rational -> TimeOfDay`

(also pattern)Construct a TimeOfDay from hour, minute, second.

** id** :

`TimeOfDay -> Literal`

Every time of day is a literal.

** parseTimeOfDay** :

`Text -> Maybe TimeOfDay`

Parse text as a time of day.

** interpretTimeOfDayAsText** :

`Ref TimeOfDay -> Ref Text`

Interpret a time of day reference as text.

** midnight** :

`TimeOfDay`

Midnight.

** midday** :

`TimeOfDay`

Midday.

** unixFormatTimeOfDay** :

`Text -> TimeOfDay -> Text`

Format a time of day as text, using a UNIX-style formatting string.

** unixParseTimeOfDay** :

`Text -> Text -> Maybe TimeOfDay`

Parse text as a time of day, using a UNIX-style formatting string.

#### Local Time

** LocalTime** :

`Date -> TimeOfDay -> LocalTime`

(also pattern)Construct a LocalTime from day and time of day.

** id** :

`LocalTime -> Literal`

Every local time is a literal.

** parseLocalTime** :

`Text -> Maybe LocalTime`

Parse text as a local time.

** interpretLocalTimeAsText** :

`Ref LocalTime -> Ref Text`

Interpret a local time reference as text.

** timeToLocal** :

`Integer -> Time -> LocalTime`

Convert a time to local time, given a time zone offset in minutes

** localToTime** :

`Integer -> LocalTime -> Time`

Convert a local time to time, given a time zone offset in minutes

** unixFormatLocalTime** :

`Text -> LocalTime -> Text`

Format a local time as text, using a UNIX-style formatting string.

** unixParseLocalTime** :

`Text -> Text -> Maybe LocalTime`

Parse text as a local time, using a UNIX-style formatting string.

** getTimeZone** :

`Time -> Action Integer`

Get the offset for a time in the current time zone.

** getCurrentTimeZone** :

`Action Integer`

Get the current time zone offset in minutes.

** getLocalTime** :

`Action LocalTime`

Get the current local time.

** newTimeZoneRef** :

`Ref +Time -> Action (Ref +Integer)`

The current time zone offset in minutes.

## Maybe

** Just** :

`a -> Maybe a`

(also pattern)Construct a Maybe from a value.

** Nothing** :

`Maybe None`

(also pattern)Construct a Maybe without a value.

** id** :

`Maybe Entity -> Entity`

Entity conversion.

## Pairs

** id** :

`(Entity, Entity) -> Entity`

Entity conversion.

** fst** :

`(a, b) -> a`

Get the first member of a pair.

** snd** :

`(a, b) -> b`

Get the second member of a pair.

** toPair** :

`a -> b -> (a, b)`

Construct a pair.

** pair** :

`a -> (a, a)`

Construct a pair.

## Either

** Left** :

`a -> Either a b`

(also pattern)Construct an Either from the left.

** Right** :

`b -> Either a b`

(also pattern)Construct an Either from the right.

** id** :

`Either Entity Entity -> Entity`

Entity conversion.

** fromEither** :

`(a -> c) -> (b -> c) -> Either a b -> c`

Eliminate an Either

** either** :

`Either a a -> a`

Eliminate an Either

## Lists

** []** :

`[None]`

(also pattern)Empty list

** ::** :

`a -> [a] -> [a]`

(also pattern)Construct a list

** id** :

`[Entity] -> Entity`

Entity conversion.

** list** :

`b -> (a -> [a] -> b) -> [a] -> b`

Eliminate a list

** length** :

`[Any] -> Integer`

Number of items in a list

** mapList** :

`(a -> b) -> [a] -> [b]`

Map the items of a list.

** ++** :

`[a] -> [a] -> [a]`

Concatentate lists.

** filter** :

`(a -> Boolean) -> [a] -> [a]`

Filter a list.

** maybeMapList** :

`(a -> Maybe b) -> [a] -> [b]`

Map and filter a list.

** take** :

`Integer -> [a] -> [a]`

Take the first n elements.

** drop** :

`Integer -> [a] -> [a]`

Drop the first n elements.

** zip** :

`[a] -> [b] -> [(a, b)]`

Zip two lists.

## Functions

** id** :

`a -> a`

The identity function.

** $** :

`(a -> b) -> a -> b`

Apply a function to a value.

** .** :

`(a -> b) -> (c -> a) -> c -> b`

Compose functions.

** error** :

`Text -> None`

Error.

## Actions

** return** :

`a -> Action a`

A value as an Action.

** >>=** :

`Action a -> (a -> Action b) -> Action b`

Bind the result of an Action to an Action.

** >>** :

`Action Any -> Action a -> Action a`

Do actions in sequence.

** mapAction** :

`(a -> b) -> Action a -> Action b`

Map a function on an action.

** fixAction** :

`(a -> Action a) -> Action a`

The fixed point of an Action.

** fail** :

`Text -> Action None`

Fail, causing the program to terminate with error.

** stop** :

`Action None`

Stop. This is similar to an exception that can be caught with

`onStop`

. The default handler (for the main program, button presses, etc.), is to catch and ignore it.** onStop** :

`Action a -> Action a -> Action a`

`onStop p q`

does `p`

first, and if it stops, then does `q`

.** for_** :

`[a] -> (a -> Action ()) -> Action ()`

Perform an action on each value of a list.

** for** :

`[a] -> (a -> Action b) -> Action [b]`

Perform an action on each value of a list, returning a list.

** output** :

`Text -> Action ()`

Output text to standard output.

** outputLn** :

`Text -> Action ()`

Output text and a newline to standard output.

** getTimeMS** :

`Action Integer`

Get the time as a whole number of milliseconds.

## Undo

Undo and redo changes.

** queueUndo** :

`Action Boolean`

Undo an action.

** queueRedo** :

`Action Boolean`

Redo an action.

## References

A reference of type `Ref {-p,+q}`

has a setting type of `p`

and a getting type of `q`

. References keep track of updates, and will update user interfaces constructed from them when their value changes.

** pureRef** :

`a -> Ref +a`

A constant reference for a value.

** immutRef** :

`Ref +a -> Ref +a`

Convert a reference to immutable.

`immutRef r = {%r}`

** coMapRef** :

`(a -> b) -> Ref {-c,+a} -> Ref {-c,+b}`

Map a function on getting a reference.

** contraMapRef** :

`(b -> a) -> Ref {-a,+c} -> Ref {-b,+c}`

Map a function on setting a reference.

** lensMapRef** :

`(aq -> b) -> (b -> Maybe aq -> Maybe ap) -> Ref {-ap,+aq} -> Ref b`

Map getter & pushback functions on a reference.

** applyRef** :

`Ref +(a -> b) -> Ref +a -> Ref +b`

Combine references.

** unknown** :

`Ref {}`

The unknown reference, representing missing information.

** known** :

`Ref {} -> Ref +Boolean`

True if the reference is known.

** ??** :

`Ref +a -> Ref +a -> Ref +a`

`p ?? q`

= `p`

if it is known, else `q`

.** get** :

`Ref +a -> Action a`

Get a reference, or

`stop`

if the reference is unknown.** runRef** :

`Ref +(Action ()) -> Action ()`

Run an action from a reference.

** :=** :

`Ref -a -> a -> Action ()`

Set a reference to a value. Stop if failed.

** delete** :

`Ref {} -> Action ()`

Delete an entity reference. Stop if failed.

** newMemRef** :

`Action (Ref a)`

Create a new reference to memory, initially unknown.

## Set References

** mapSet** :

`(a -> b) -> SetRef b -> SetRef a`

Map a function on a set.

** pureSet** :

`(a -> Boolean) -> SetRef (Entity & a)`

Convert a predicate to a set.

** refSet** :

`Ref {-((Entity & a) -> Boolean),+(a -> Boolean)} -> SetRef (Entity & a)`

Convert a predicate reference to a set.

** immutSet** :

`SetRef a -> SetRef a`

Convert a set to immutable.

** +=** :

`SetRef a -> a -> Action ()`

Add an entity to a set.

** -=** :

`SetRef a -> a -> Action ()`

Remove an entity from a set.

** newEntity** :

`SetRef NewEntity -> Action NewEntity`

Create a new entity in a set and act on it.

** member** :

`SetRef a -> Ref +a -> Ref Boolean`

A reference to the membership of a value in a set.

** notSet** :

`SetRef a -> SetRef a`

Complement of a set. The resulting set can be added to (deleting from the original set) and deleted from (adding to the original set).

** <&>** :

`SetRef a -> SetRef a -> SetRef a`

Intersection of sets. The resulting set can be added to (adding to both sets), but not deleted from.

** <|>** :

`SetRef a -> SetRef a -> SetRef a`

Union of sets. The resulting set can be deleted from (deleting from both sets), but not added to.

** <\>** :

`SetRef a -> SetRef a -> SetRef a`

Difference of sets, everything in the first set but not the second. The resulting set can be added to (adding to the first and deleting from the second), but not deleted from.

** <^>** :

`SetRef a -> SetRef a -> SetRef a`

Symmetric difference of sets, everything in exactly one of the sets. The resulting set will be read-only.

** <+>** :

`SetRef a -> SetRef b -> SetRef (Either a b)`

Cartesian sum of sets.

** <*>** :

`SetRef a -> SetRef b -> SetRef (a, b)`

Cartesian product of sets. The resulting set will be read-only.

## Finite Set References

** id** :

`FiniteSetRef -a -> SetRef a`

Every finite set is a set.

** coMapFiniteSet** :

`(a -> b) -> FiniteSetRef {-c,+a} -> FiniteSetRef {-c,+b}`

Map a function on getting from a finite set.

** contraMapFiniteSet** :

`(b -> a) -> FiniteSetRef {-a,+c} -> FiniteSetRef {-b,+c}`

Map a function on setting to and testing a finite set.

** <:&>** :

`FiniteSetRef {-a,+b} -> SetRef b -> FiniteSetRef {-a,+b}`

Intersect a finite set with any set. The resulting finite set will be read-only.

** <:\>** :

`FiniteSetRef {-a,+b} -> SetRef b -> FiniteSetRef {-a,+b}`

Difference of a finite set and any set. The resulting finite set will be read-only.

** <:&:>** :

`FiniteSetRef {a,+Entity} -> FiniteSetRef {a,+Entity} -> FiniteSetRef {a,-Entity}`

Intersection of finite sets. The resulting finite set can be added to, but not deleted from.

** <:|:>** :

`FiniteSetRef {a,+Entity} -> FiniteSetRef {a,+Entity} -> FiniteSetRef {a,-Entity}`

Union of finite sets. The resulting finite set can be deleted from, but not added to.

** <:+:>** :

`FiniteSetRef {-ap,+aq} -> FiniteSetRef {-bp,+bq} -> FiniteSetRef {-(Either ap bp),+(Either aq bq)}`

Cartesian sum of finite sets.

** <:+:>** :

`FiniteSetRef a -> FiniteSetRef b -> FiniteSetRef (Either a b)`

Cartesian sum of finite sets.

** <:*:>** :

`FiniteSetRef {-ap,+aq} -> FiniteSetRef {-bp,+bq} -> FiniteSetRef {-(ap, bp),+(aq, bq)}`

Cartesian product of finite sets. The resulting finite set will be read-only.

** <:*:>** :

`FiniteSetRef a -> FiniteSetRef b -> FiniteSetRef (a, b)`

Cartesian product of finite sets. The resulting finite set will be read-only.

** members** :

`Order a -> FiniteSetRef +a -> Ref +[a]`

Get all members of a finite set, by an order.

** listFiniteSet** :

`Ref {-[a],+[Entity & a]} -> FiniteSetRef {a,-Entity}`

Represent a reference to a list as a finite set. Changing the set may scramble the order of the list.

** single** :

`FiniteSetRef {+Entity,+a} -> Ref +a`

The member of a single-member finite set, or unknown.

** count** :

`FiniteSetRef {} -> Ref +Integer`

Count of members in a finite set.

** removeAll** :

`FiniteSetRef {} -> Action ()`

Remove all entities from a finite set.

** newMemFiniteSet** :

`Action (FiniteSetRef {a,-Entity})`

Create a new finite set reference to memory, initially empty.

## Morphisms

Morphisms relate entities.

** identity** :

`{-x,+y} ~> {-y,+x}`

The identity morphism.

** !.** :

`({-bx,+by} ~> {-cp,+cq}) -> ({-ap,+aq} ~> {-by,+bx}) -> {-ap,+aq} ~> {-cp,+cq}`

Compose morphisms.

** !.** :

`(b ~> c) -> (a ~> b) -> a ~> c`

Compose morphisms.

** !**** :

`({-ap,+Entity,+aq} ~> {-bp,+bq}) -> ({-ap,+Entity,+aq} ~> {-cp,+cq}) -> {-ap,+aq} ~> {-(bp, cp),+(bq, cq)}`

Pair morphisms. References from these morphisms are undeleteable.

** !**** :

`({a,+Entity} ~> b) -> ({a,+Entity} ~> c) -> a ~> (b, c)`

Pair morphisms. References from these morphisms are undeleteable.

** !++** :

`({-ap,+aq} ~> {-cp,+cq}) -> ({-bp,+bq} ~> {-cp,+cq}) -> {-(Either ap bp),+(Either aq bq)} ~> {-cp,+cq}`

Either morphisms. References from these morphisms are undeleteable.

** !++** :

`(a ~> c) -> (b ~> c) -> (Either a b) ~> c`

Either morphisms. References from these morphisms are undeleteable.

** !$** :

`({-ap,+aq} ~> {-bp,+bq}) -> Ref {-aq,+ap} -> Ref {-bp,+bq}`

Apply a morphism to a reference.

** !$** :

`(a ~> b) -> Ref a -> Ref b`

Apply a morphism to a reference.

** !$%** :

`(-a ~> {-bp,+bq}) -> Ref +a -> Ref {-bp,+bq}`

Apply a morphism to an immutable reference.

`m !$% r = m !$ immutRef r`

** !$%** :

`(-a ~> b) -> Ref +a -> Ref b`

Apply a morphism to an immutable reference.

`m !$% r = m !$ immutRef r`

** !$$** :

`(-a ~> {+Entity,+b}) -> FiniteSetRef +a -> FiniteSetRef {b,-Entity}`

Apply a morphism to a set.

** !@** :

`({a,+Entity} ~> {-bx,+by}) -> Ref {-by,+bx} -> FiniteSetRef {a,-Entity}`

Co-apply a morphism to a reference.

** !@** :

`({a,+Entity} ~> b) -> Ref b -> FiniteSetRef {a,-Entity}`

Co-apply a morphism to a reference.

** !@%** :

`({a,+Entity} ~> -b) -> Ref +b -> FiniteSetRef {a,-Entity}`

Co-apply a morphism to an immutable reference.

`m !@% r = m !@ immutRef r`

** !@@** :

`({a,+Entity} ~> {-bx,+by}) -> FiniteSetRef {-NewEntity,-by,+bx} -> FiniteSetRef {a,-Entity}`

Co-apply a morphism to a set.

** !@@** :

`({a,+Entity} ~> b) -> FiniteSetRef {b,-NewEntity} -> FiniteSetRef {a,-Entity}`

Co-apply a morphism to a set.

## Orders

** alphabetical** :

`Order Text`

Alphabetical order.

** numerical** :

`Order Number`

Numercal order.

** chronological** :

`Order Time`

Chronological order.

** durational** :

`Order Duration`

Durational order.

** calendrical** :

`Order Date`

Date order.

** horological** :

`Order TimeOfDay`

Time of day order.

** localChronological** :

`Order LocalTime`

Local time order.

** noOrder** :

`Order Any`

No order, same as

`orders []`

.** orders** :

`[Order a] -> Order a`

Join orders by priority.

** mapOrder** :

`(b -> a) -> Order a -> Order b`

Map a function on an order.

** orderOn** :

`(-b ~> +a) -> Order a -> Order b`

Order by an order on a particular morphism.

** rev** :

`Order a -> Order a`

Reverse an order.

** orderEQ** :

`Order a -> Ref +a -> Ref +a -> Ref +Boolean`

Equal by an order.

** orderLT** :

`Order a -> Ref +a -> Ref +a -> Ref +Boolean`

Less than by an order.

** orderLE** :

`Order a -> Ref +a -> Ref +a -> Ref +Boolean`

Less than or equal to by an order.

** orderGT** :

`Order a -> Ref +a -> Ref +a -> Ref +Boolean`

Greater than by an order.

** orderGE** :

`Order a -> Ref +a -> Ref +a -> Ref +Boolean`

Greater than or equal to by an order.

## Notifiers

Notifiers are used to track selections in some UI elements.

** noNotifier** :

`Notifier Any`

No notifier, same as

`notifiers []`

.** notifiers** :

`[Notifier a] -> Notifier a`

Join notifiers.

** mapNotifier** :

`(b -> a) -> Notifier a -> Notifier b`

Map notifier.

** makeNotifier** :

`Action (Notifier a, Action a)`

Create a notifier.

** notify** :

`Notifier a -> Maybe a -> Action ()`

Notify a notifier.

## UI

A user interface is something that goes inside a window.

** uiRun** :

`Action UI -> UI`

UI that runs an Action first.

** uiBlank** :

`UI`

Blank user-interface

** uiUnitCheckBox** :

`Ref +Text -> Ref () -> UI`

(TBD)

** uiCheckBox** :

`Ref +Text -> Ref Boolean -> UI`

Checkbox. Use shift-click to set to unknown.

** uiTextEntry** :

`Ref Text -> UI`

Text entry, unknown reference will be interpreted as empty text, but the UI will not delete the reference.

** uiTextArea** :

`Ref Text -> UI`

Text area, unknown reference will be interpreted as empty text, but the UI will not delete the reference.

** uiLabel** :

`Ref +Text -> UI`

Label.

** uiHorizontal** :

`[(UI, Boolean)] -> UI`

Items arranged horizontally, each flag is whether to expand into remaining space.

** uiVertical** :

`[(UI, Boolean)] -> UI`

Items arranged vertically, each flag is whether to expand into remaining space.

** uiPages** :

`[(UI, UI)] -> UI`

A notebook of pages. First of each pair is for the page tab (typically a label), second is the content.

** uiButton** :

`Ref +Text -> Ref +(Action Any) -> UI`

A button with this text that does this action. Button will be disabled if the action reference is unknown.

** uiPick** :

`Ref +[(Entity & a, Text)] -> Ref {a,+Entity} -> UI`

A drop-down menu.

** uiTable** :

`[(Ref +Text, a -> Ref +Text)] -> Order a -> FiniteSetRef {a,+Entity} -> (a -> Action Any) -> Notifier a -> UI`

A list table. First arg is columns (name, property), second is order, third is the set of items, fourth is the window to open for a selection.

** uiCalendar** :

`Ref Date -> UI`

A calendar.

** uiScrolled** :

`UI -> UI`

A scrollable container.

** uiDynamic** :

`Ref +UI -> UI`

A UI that can be updated to different UIs.

## Menu

Menu items.

** menuSeparator** :

`MenuItem`

Separator menu item.

** menuSubmenu** :

`Text -> [MenuItem] -> MenuItem`

Submenu menu item.

** menuAction** :

`Text -> Maybe Text -> Ref +(Action Any) -> MenuItem`

Action menu item. Item will be disabled if the action reference is unknown.

## Window

User interface windows.

** openWindow** :

`Ref +Text -> Ref +[MenuItem] -> UI -> Action Window`

Open a new window with this title and UI.

** closeWindow** :

`Window -> Action ()`

Close a window.

** exitUI** :

`Action ()`

Exit the user interface.

## Files

NYI