-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Coya monoids -- -- Take some log semiring R. Then, for any two x,y :: R, the following -- holds: -- -- x ^ log y == y ^ log x == e ^ (log x * log y) -- -- A Coya monoid is some commutative monoid (R, y = x ^ log y. The -- following laws hold: -- -- e # x = x (Left Identity) -- -- x # e = x (Right Identity) -- -- (x z == x z) (Associativity) -- -- x x (Commutativity) -- -- If the R is a poset where all elements in R are greater than one, then -- R also forms a group: -- -- x # (e ^ (1 / log (x))) == x @package coya @version 0.1 -- | Consider some log-semiring R. Then, for any two x,y :: R, the -- following holds: -- --
-- x ^ log y == y ^ log x == e ^ (log x * log y) ---- -- Coya is a commutative monoid (R, y = x ^ log y. -- -- The following laws hold: -- --
-- x # (exp (1 / log x)) = x --module Coya -- | The Coya monoid. Its semigroup instance is a binary -- operation that distributes over multiplication, i.e: -- --
-- Coya x <> (Coya y * Coya z) == (Coya x <> Coya y) * (Coya x <> Coya z) ---- -- The Semiring and Num instances simply lift the -- underlying type's. newtype Coya a Coya :: a -> Coya a [getCoya] :: Coya a -> a -- | The Coya monoid constrained to numbers which are greater than -- 1. This ensures that the group property of inversion holds: -- --
-- x <> (exp (1 / log x)) == x --newtype CoyaGroup a CoyaGroup :: Refined (From 1) (Coya a) -> CoyaGroup a [getCoyaGroup] :: CoyaGroup a -> Refined (From 1) (Coya a) -- | A smart constructor for CoyaGroup. coyaGroup :: forall a. (Ord a, Num a) => a -> Maybe (CoyaGroup a) instance GHC.Read.Read a => GHC.Read.Read (Coya.Coya a) instance GHC.Show.Show a => GHC.Show.Show (Coya.Coya a) instance Data.Primitive.Types.Prim a => Data.Primitive.Types.Prim (Coya.Coya a) instance Foreign.Storable.Storable a => Foreign.Storable.Storable (Coya.Coya a) instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Coya.Coya a) instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Coya.Coya a) instance GHC.Real.Real a => GHC.Real.Real (Coya.Coya a) instance GHC.Real.Fractional a => GHC.Real.Fractional (Coya.Coya a) instance GHC.Float.Floating a => GHC.Float.Floating (Coya.Coya a) instance GHC.Num.Num a => GHC.Num.Num (Coya.Coya a) instance Data.Semiring.Ring a => Data.Semiring.Ring (Coya.Coya a) instance Data.Semiring.Semiring a => Data.Semiring.Semiring (Coya.Coya a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Coya.Coya a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Coya.Coya a) instance (GHC.Float.Floating a, GHC.Classes.Ord a) => GHC.Base.Semigroup (Coya.CoyaGroup a) instance (GHC.Float.Floating a, GHC.Classes.Ord a) => GHC.Base.Monoid (Coya.CoyaGroup a) instance (GHC.Float.Floating a, GHC.Classes.Ord a) => Data.Group.Group (Coya.CoyaGroup a) instance GHC.Float.Floating a => GHC.Base.Semigroup (Coya.Coya a) instance GHC.Float.Floating a => GHC.Base.Monoid (Coya.Coya a)