module Plankton.Basis
( AdditiveBasis(..)
, AdditiveGroupBasis(..)
, MultiplicativeBasis(..)
, MultiplicativeGroupBasis(..)
) where
import Data.Functor.Rep
import Plankton.Additive
import Plankton.Multiplicative
class (Representable m, Additive a) =>
AdditiveBasis m a where
infixl 7 .+.
(.+.) :: m a -> m a -> m a
(.+.) = liftR2 (+)
instance (Representable r, Additive a) => AdditiveBasis r a
class (Representable m, AdditiveGroup a) =>
AdditiveGroupBasis m a where
infixl 6 .-.
(.-.) :: m a -> m a -> m a
(.-.) = liftR2 ()
instance (Representable r, AdditiveGroup a) => AdditiveGroupBasis r a
class (Representable m, Multiplicative a) =>
MultiplicativeBasis m a where
infixl 7 .*.
(.*.) :: m a -> m a -> m a
(.*.) = liftR2 (*)
instance (Representable r, Multiplicative a) => MultiplicativeBasis r a
class (Representable m, MultiplicativeGroup a) =>
MultiplicativeGroupBasis m a where
infixl 7 ./.
(./.) :: m a -> m a -> m a
(./.) = liftR2 (/)
instance (Representable r, MultiplicativeGroup a) =>
MultiplicativeGroupBasis r a