monoidal-functors-0.2.0.0: Monoidal Functors Library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Category.Tensor.Expr

Synopsis

Type Families

type family MConcat mappend mempty xs where ... Source #

Examples:

>>> :{
 let foo :: Tensored (,) () '[Bool, Int]
     foo = Tensored (True, (8, ()))
:}
>>> :{
let bar :: Tensored Either Void '[Bool, Int]
    bar = Tensored $ Right $ Left 8
:}
>>> :{
let baz :: Tensored These Void '[Bool, Int]
    baz = Tensored $ These True $ This 8
:}

Equations

MConcat mappend mempty '[] = mempty 
MConcat mappend mempty (x ': xs) = mappend x (MConcat mappend mempty xs) 

newtype Tensored t i xs Source #

Constructors

Tensored 

Fields

Instances

Instances details
Show (MConcat t i xs) => Show (Tensored t i xs) Source # 
Instance details

Defined in Control.Category.Tensor.Expr

Methods

showsPrec :: Int -> Tensored t i xs -> ShowS #

show :: Tensored t i xs -> String #

showList :: [Tensored t i xs] -> ShowS #

Eq (MConcat t i xs) => Eq (Tensored t i xs) Source # 
Instance details

Defined in Control.Category.Tensor.Expr

Methods

(==) :: Tensored t i xs -> Tensored t i xs -> Bool #

(/=) :: Tensored t i xs -> Tensored t i xs -> Bool #

Ord (MConcat t i xs) => Ord (Tensored t i xs) Source # 
Instance details

Defined in Control.Category.Tensor.Expr

Methods

compare :: Tensored t i xs -> Tensored t i xs -> Ordering #

(<) :: Tensored t i xs -> Tensored t i xs -> Bool #

(<=) :: Tensored t i xs -> Tensored t i xs -> Bool #

(>) :: Tensored t i xs -> Tensored t i xs -> Bool #

(>=) :: Tensored t i xs -> Tensored t i xs -> Bool #

max :: Tensored t i xs -> Tensored t i xs -> Tensored t i xs #

min :: Tensored t i xs -> Tensored t i xs -> Tensored t i xs #

type family xs ++ ys where ... Source #

Equations

'[] ++ xs = xs 
(x ': xs) ++ ys = x ': (xs ++ ys) 

AppendTensored

class AppendTensored xs where Source #

Methods

appendTensored :: Tensor (->) t i => (Tensored t i xs `t` Tensored t i ys) -> Tensored t i (xs ++ ys) Source #

Instances

Instances details
AppendTensored ('[] :: [Type]) Source # 
Instance details

Defined in Control.Category.Tensor.Expr

Methods

appendTensored :: forall t i (ys :: [Type]). Tensor (->) t i => t (Tensored t i '[]) (Tensored t i ys) -> Tensored t i ('[] ++ ys) Source #

AppendTensored xs => AppendTensored (x ': xs) Source # 
Instance details

Defined in Control.Category.Tensor.Expr

Methods

appendTensored :: forall t i (ys :: [Type]). Tensor (->) t i => t (Tensored t i (x ': xs)) (Tensored t i ys) -> Tensored t i ((x ': xs) ++ ys) Source #