Safe Haskell | None |
---|
- newtype T a = Cons {
- decons :: a
- liftM :: Monad m => (a -> m b) -> T a -> m (T b)
- liftM2 :: Monad m => (a -> b -> m c) -> T a -> T b -> m (T c)
- unliftM :: Monad m => (T a -> m (T r)) -> a -> m r
- unliftM2 :: Monad m => (T a -> T b -> m (T r)) -> a -> b -> m r
- unliftM3 :: Monad m => (T a -> T b -> T c -> m (T r)) -> a -> b -> c -> m r
- unliftM4 :: Monad m => (T a -> T b -> T c -> T d -> m (T r)) -> a -> b -> c -> d -> m r
- unliftM5 :: Monad m => (T a -> T b -> T c -> T d -> T e -> m (T r)) -> a -> b -> c -> d -> e -> m r
Documentation
The entire purpose of this datatype is to mark a type as scalar,
although it might also be interpreted as vector.
This way you can write generic operations for vectors
using the PseudoModule
class,
and specialise them to scalar types with respect to the PseudoRing
class.
From another perspective
you can consider the T
type constructor a marker
where the Scalar
type function
stops reducing nested vector types to scalar types.
Phi a => Phi (T a) | |
Zero a => Zero (T a) | |
Undefined a => Undefined (T a) | |
Transcendental a => Transcendental (T a) | |
Algebraic a => Algebraic (T a) | |
Fraction a => Fraction (T a) | |
Real a => Real (T a) | |
RationalConstant a => RationalConstant (T a) | |
Field a => Field (T a) | |
IntegerConstant a => IntegerConstant (T a) | |
PseudoRing a => PseudoModule (T a) | |
PseudoRing a => PseudoRing (T a) | |
Additive a => Additive (T a) | |
C a => C (T a) |