noether

TODO


Keywords
benchmark, library, mit, program, test, Lemmata, Lemmata.Applicative, Lemmata.Base, Lemmata.Bifunctor, Lemmata.Bool, Lemmata.Conv, Lemmata.Debug, Lemmata.Either, Lemmata.Exceptions, Lemmata.Functor, Lemmata.List, Lemmata.Monad, Lemmata.Panic, Lemmata.Semiring, Lemmata.Show, Lemmata.Unsafe, Noether.Algebra.Actions, Noether.Algebra.Actions.API, Noether.Algebra.Actions.Acts, Noether.Algebra.Actions.Compatible, Noether.Algebra.Actions.GroupActions, Noether.Algebra.Actions.Linearity, Noether.Algebra.Actions.Strategies, Noether.Algebra.Derive, Noether.Algebra.Inference, Noether.Algebra.Linear, Noether.Algebra.Linear.API, Noether.Algebra.Linear.Module, Noether.Algebra.Linear.Strategies, Noether.Algebra.Multiple, Noether.Algebra.Multiple.Ring, Noether.Algebra.Multiple.Semiring, Noether.Algebra.Multiple.Strategies, Noether.Algebra.Single, Noether.Algebra.Single.API, Noether.Algebra.Single.AbelianGroup, Noether.Algebra.Single.Cancellative, Noether.Algebra.Single.Commutative, Noether.Algebra.Single.Group, Noether.Algebra.Single.Magma, Noether.Algebra.Single.Monoid, Noether.Algebra.Single.Neutral, Noether.Algebra.Single.Semigroup, Noether.Algebra.Single.Strategies, Noether.Algebra.Single.Synonyms, Noether.Algebra.Subtyping, Noether.Algebra.Tags, Noether.Algebra.Vector.Boxed, Noether.Algebra.Vector.Generic, Noether.Algebra.Vector.Tags, Noether.Algebra.Vector.Tutorial, Noether.Algebra.Vector.Unboxed, Noether.Equality, Noether.Equality.Tutorial, Noether.Lemmata.Prelude, Noether.Lemmata.TypeFu, Noether.Lemmata.TypeFu.DList, Noether.Lemmata.TypeFu.Map, Noether.Lemmata.TypeFu.Set
License
MIT
Install
cabal install noether-0.0.1

Documentation

Noether

FULLPOLYMORPHIC™ number theory / abstract algebra in Haskell.

The part I'm working on at present develops a highly polymorphic numeric hierarchy. Unlike almost every other project (including the great subhask, which is by far the biggest inspiration for this project), all typeclasses representing algebraic structures are "tagged" with the operations that the base type supports. The intention is to have, without newtyping, things like automatically specified L-vector space instances for any K-vector space with K / L a (nice) field extension.

Other stuff

Some other stuff I'm thinking about includes polymorphic numeric literals, possibly along the lines of this:

type family NumericLit (n :: Nat) = (c :: * -> Constraint) where
  NumericLit 0 = Neutral Add
  NumericLit 1 = Neutral Mul
  -- NumericLit 2 = Field Add Mul
  -- NumericLit n = NumericLit (n - 1)
  NumericLit n = Ring Add Mul

fromIntegerP :: forall n a. (KnownNat n, NumericLit n a) => Proxy n -> a
fromIntegerP p =
  case sameNat p (Proxy :: Proxy 0) of
    Just prf -> gcastWith prf zero'
    Nothing -> case sameNat p (Proxy :: Proxy 1) of
      Just prf -> gcastWith prf one'
      Nothing -> undefined -- unsafeCoerce (val (Proxy :: Proxy a))
        -- where
        --   val :: (Field Add Mul b) => Proxy b -> b
        --   val _ = one + undefined -- fromIntegerP (Proxy :: Proxy (n - 1))

The original core of the project is a short implementation of elliptic curve addition over Q, which I've put on hold temporarily as I try to work out the issues outlined above first. This part uses a Protolude "fork" called Lemmata that I expect will evolve over time.