packages feed

moonlight-algebra-0.1.0.1: moonlight-algebra.cabal

cabal-version:       3.4
name:                moonlight-algebra
version:             0.1.0.1
homepage:            https://github.com/PaleRoses/moonlight
bug-reports:         https://github.com/PaleRoses/moonlight/issues
synopsis:            Algebraic type class tower for Pale Meridian.
description:         A tower of pure, law-governed algebraic structures: semigroups, monoids and groups, lattices up to Heyting and Boolean algebras, integral and Euclidean domains, modules and vector spaces, modular arithmetic, and free constructions, plus the public finite-lattice sublibrary for checked finite-order compilation and dense query plans.
license:             MIT
license-file:        LICENSE
author:              Blue Rose
maintainer:          rosaliafialkova@gmail.com
copyright:           (c) 2026 Blue Rose
category:            Math
build-type:          Simple
tested-with:         GHC == 9.14.1
extra-doc-files:
  README.md
  CHANGELOG.md
  docs/finite-lattice/BENCHMARKS-m4-pro.md

source-repository head
  type:     git
  location: https://github.com/PaleRoses/moonlight.git
  subdir:   moonlight-algebra

common shared-properties
  default-language: GHC2024
  ghc-options:
    -Wall
    -Wcompat
    -Wincomplete-record-updates
    -Wincomplete-uni-patterns
    -Wredundant-constraints
    -Wpartial-fields
    -Wno-missing-import-lists
  default-extensions:
    TypeFamilies
    UndecidableInstances

library abstract
  import: shared-properties
  visibility: public
  hs-source-dirs: src-abstract
  exposed-modules:
    Moonlight.Algebra.Pure.Action
    Moonlight.Algebra.Pure.EndoPatch
    Moonlight.Algebra.Pure.FreeAbelianGroup
    Moonlight.Algebra.Pure.FreeMonoid
    Moonlight.Algebra.Pure.GCD
    Moonlight.Algebra.Pure.Group
    Moonlight.Algebra.Pure.Lattice
    Moonlight.Algebra.Pure.LaneVector
    Moonlight.Algebra.Pure.Magnitude
    Moonlight.Algebra.Pure.Module
    Moonlight.Algebra.Pure.NumberTheory
    Moonlight.Algebra.Pure.Orientation
    Moonlight.Algebra.Pure.Polynomial
    Moonlight.Algebra.Pure.PowerSet
    Moonlight.Algebra.Pure.Product
    Moonlight.Algebra.Pure.Quotient
    Moonlight.Algebra.Pure.Ring
    Moonlight.Algebra.Pure.SparseVec
    Moonlight.Algebra.Pure.Zn
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , moonlight-algebra:moonlight-algebra-internal
    , moonlight-core >= 0.1 && < 0.2
    , vector >= 0.13 && < 0.14

library
  import: shared-properties
  hs-source-dirs: src-public
  exposed-modules:
    Moonlight.Algebra
  build-depends:
    base >= 4.22 && < 5
    , moonlight-algebra:abstract
    , moonlight-core >= 0.1 && < 0.2

library finite-lattice
  import: shared-properties
  visibility: public
  hs-source-dirs: src-finite-lattice
  default-extensions:
    FunctionalDependencies
  exposed-modules:
    Moonlight.FiniteLattice
    Moonlight.FiniteLattice.Core
    Moonlight.FiniteLattice.Cover
    Moonlight.FiniteLattice.Fixpoint
    Moonlight.FiniteLattice.Heyting
    Moonlight.FiniteLattice.Presentation
    Moonlight.FiniteLattice.Resident
    Moonlight.FiniteLattice.Support
  other-modules:
    Moonlight.FiniteLattice.Internal.Compile
    Moonlight.FiniteLattice.Internal.Dense
    Moonlight.FiniteLattice.Internal.Distributive
    Moonlight.FiniteLattice.Internal.Index
    Moonlight.FiniteLattice.Internal.Invariant
    Moonlight.FiniteLattice.Internal.Key
    Moonlight.FiniteLattice.Internal.Layout
    Moonlight.FiniteLattice.Internal.Plan
    Moonlight.FiniteLattice.Internal.Recognize
    Moonlight.FiniteLattice.Internal.Relation
    Moonlight.FiniteLattice.Internal.Topological
    Moonlight.FiniteLattice.Internal.Types
    Moonlight.FiniteLattice.Internal.Validate
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , moonlight-algebra:abstract
    , moonlight-core >= 0.1 && < 0.2
    , vector >= 0.13 && < 0.14

library moonlight-algebra-internal
  import: shared-properties
  visibility: private
  hs-source-dirs: src-internal
  exposed-modules:
    Moonlight.Algebra.Unsafe.GCDWitness
  build-depends:
    base >= 4.22 && < 5
    , moonlight-core >= 0.1 && < 0.2

library moonlight-algebra-laws
  import: shared-properties
  visibility: private
  hs-source-dirs: src-laws
  exposed-modules:
    Moonlight.Algebra.Effect.LawNames
    Moonlight.Algebra.Effect.Laws
    Moonlight.Algebra.Test.Generators
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , hedgehog >= 1.2 && < 1.8
    , moonlight-algebra
    , moonlight-algebra:moonlight-algebra-internal
    , moonlight-core >= 0.1 && < 0.2
    , moonlight-pale:test-laws >= 0.1 && < 0.2
    , tasty >= 1.4 && < 1.6
    , tasty-hedgehog >= 1.4 && < 1.5
    , tasty-hunit >= 0.10 && < 0.11
    , vector >= 0.13 && < 0.14

test-suite moonlight-algebra-abstract-test
  type: exitcode-stdio-1.0
  default-language: GHC2024
  hs-source-dirs: test/abstract
  main-is: Main.hs
  other-modules:
    AbstractTests
    OrderedLatticeSpec
    SparseVecSpec
  ghc-options: -Wall -Wcompat
  default-extensions:
    TypeFamilies
    UndecidableInstances
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , moonlight-algebra
    , moonlight-algebra:abstract
    , moonlight-algebra:moonlight-algebra-laws
    , moonlight-core >= 0.1 && < 0.2
    , moonlight-pale:test >= 0.1 && < 0.2
    , tasty >= 1.4 && < 1.6
    , tasty-hunit >= 0.10 && < 0.11
    , tasty-hedgehog >= 1.4 && < 1.5
    , hedgehog >= 1.2 && < 1.8

test-suite moonlight-algebra-finite-lattice-test
  import: shared-properties
  type: exitcode-stdio-1.0
  hs-source-dirs: test/finite-lattice
  main-is: Main.hs
  other-modules:
    FiniteLatticeSpec
    FiniteLatticeTests
    LawSpec
    PresentationSpec
  default-extensions:
    FunctionalDependencies
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , moonlight-algebra:finite-lattice
    , moonlight-pale:test >= 0.1 && < 0.2
    , tasty >= 1.4 && < 1.6
    , tasty-hunit >= 0.10 && < 0.11
    , tasty-quickcheck >= 0.10 && < 0.12
    , QuickCheck >= 2.14 && < 2.19

test-suite moonlight-algebra-test
  import: shared-properties
  type: exitcode-stdio-1.0
  hs-source-dirs:
    test/aggregate
    test/abstract
    test/finite-lattice
  main-is: Main.hs
  other-modules:
    AbstractTests
    FiniteLatticeSpec
    FiniteLatticeTests
    LawSpec
    OrderedLatticeSpec
    PresentationSpec
    SparseVecSpec
  default-extensions:
    FunctionalDependencies
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , hedgehog >= 1.2 && < 1.8
    , moonlight-algebra
    , moonlight-algebra:abstract
    , moonlight-algebra:finite-lattice
    , moonlight-algebra:moonlight-algebra-laws
    , moonlight-core >= 0.1 && < 0.2
    , moonlight-pale:test >= 0.1 && < 0.2
    , tasty >= 1.4 && < 1.6
    , tasty-hedgehog >= 1.4 && < 1.5
    , tasty-hunit >= 0.10 && < 0.11
    , tasty-quickcheck >= 0.10 && < 0.12
    , QuickCheck >= 2.14 && < 2.19

benchmark moonlight-algebra-abstract-bench
  import: shared-properties
  type: exitcode-stdio-1.0
  hs-source-dirs: bench/abstract
  main-is: Main.hs
  other-modules:
    AbstractBench
  ghc-options: -O2
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , deepseq >= 1.4 && < 1.6
    , moonlight-algebra
    , moonlight-algebra:abstract
    , moonlight-core >= 0.1 && < 0.2
    , moonlight-pale:bench >= 0.1 && < 0.2
    , tasty-bench >= 0.3 && < 0.6
    , vector >= 0.13 && < 0.14

benchmark moonlight-algebra-finite-lattice-bench
  import: shared-properties
  type: exitcode-stdio-1.0
  hs-source-dirs: bench/finite-lattice
  main-is: Main.hs
  other-modules:
    Atomic
    Finite
    FiniteLatticeBench
    Fixtures
    JoinMeet
    Kernels
    Rows
    Support
    Tableless
  default-extensions:
    FunctionalDependencies
  ghc-options: -O2
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , deepseq >= 1.4 && < 1.6
    , lattices >= 2.2 && < 2.3
    , moonlight-algebra:finite-lattice
    , moonlight-pale:bench >= 0.1 && < 0.2
    , tasty-bench >= 0.3 && < 0.6
    , vector >= 0.13 && < 0.14

benchmark moonlight-algebra-bench
  import: shared-properties
  type: exitcode-stdio-1.0
  hs-source-dirs:
    bench/aggregate
    bench/abstract
    bench/finite-lattice
  main-is: Main.hs
  other-modules:
    AbstractBench
    Atomic
    Finite
    FiniteLatticeBench
    Fixtures
    JoinMeet
    Kernels
    Rows
    Support
    Tableless
  default-extensions:
    FunctionalDependencies
  ghc-options: -O2
  build-depends:
    base >= 4.22 && < 5
    , containers >= 0.6 && < 0.9
    , deepseq >= 1.4 && < 1.6
    , lattices >= 2.2 && < 2.3
    , moonlight-algebra
    , moonlight-algebra:abstract
    , moonlight-algebra:finite-lattice
    , moonlight-core >= 0.1 && < 0.2
    , moonlight-pale:bench >= 0.1 && < 0.2
    , tasty-bench >= 0.3 && < 0.6
    , vector >= 0.13 && < 0.14