moonlight-algebra

Algebraic type class tower for Pale Meridian.

moonlight-algebra

Part of Moonlight, the sheaf-theoretic computation layer beneath Melusine and Pale Meridian.

The law-governed algebraic tower the rest of the cathedral stands on.

moonlight-algebra is Moonlight's algebraic tier, building on moonlight-core. The front door is the umbrella module Moonlight.Algebra, whose header carries the tower's shape and its relationship to core; the public finite-lattice sublibrary has its own front door, Moonlight.FiniteLattice, whose header carries the compiled-lattice cookbook.

Public modules

ModuleSurface
Moonlight.AlgebraUmbrella re-export of the whole tower, plus the operation-bearing numeric classes from moonlight-core.
Moonlight.Algebra.Pure.GroupStandard Semigroup/Monoid, Group/AbelianGroup, and Additive/Multiplicative wrappers.
Moonlight.Algebra.Pure.FreeMonoid, .FreeAbelianGroupFree monoids and free abelian groups.
Moonlight.Algebra.Pure.ActionMonoid actions (Action) and their group-acting refinement (InvertibleAction).
Moonlight.Algebra.Pure.OrientationThe two-element sign/orientation group ℤ/2 with a direct standard monoid/group instance.
Moonlight.Algebra.Pure.LatticeJoin/meet semilattices up to Heyting and Boolean algebras.
Moonlight.FiniteLattice.*Public finite-lattice sublibrary: checked finite-order compilation, dense query plans, resident keys, Heyting implication, fixpoints, covers, presentation builders, and support kernels.
Moonlight.Algebra.Pure.RingRe-exported semiring/commutative-ring law classes plus integral/GCD/Euclidean/canonical-domain refinements.
Moonlight.Algebra.Pure.Zn, .QuotientModular arithmetic and quotient rings R/(n).
Moonlight.Algebra.Pure.NumberTheory, .GCDNumber theory and gcd.
Moonlight.Algebra.Pure.PolynomialUnivariate polynomials over a coefficient ring; a free module on monomial degrees.
Moonlight.Algebra.Pure.ModuleModules, free modules, vector spaces, and bilinear spaces over a field.
Moonlight.Algebra.Pure.MagnitudeReal-valued magnitudes for obstructions.
Moonlight.Algebra.Pure.PowerSet, .ProductPower-set lattices and finite n-fold product algebras (coordinatewise structure).
Moonlight.Algebra.Pure.SparseVecSparse vectors with finite support.

All Moonlight.Algebra.Pure.* leaves are exposed by the public abstract sublibrary and gathered by the Moonlight.Algebra surface. The unsafe GCD witness (Moonlight.Algebra.Unsafe.GCDWitness) lives in the private moonlight-algebra-internal sublibrary, the compiled finite lattice realization lives in the public finite-lattice sublibrary, and the law suite (Moonlight.Algebra.Effect.Laws, Moonlight.Algebra.Test.Generators) lives in the private moonlight-algebra-laws sublibrary.

Performance

Compilation and the resident-key and <= query paths are fast; join/meet throughput and the compiled ContextLattice query surface are under active performance work.

License

MIT; see LICENSE.

Install

cabal install moonlight-algebra