tensor-0.2.0: A completely type-safe library for linear algebra

Safe Haskell Safe-Inferred

Data.Cardinal

Synopsis

# Documentation

data Zero Source

Instances

 Show Zero Generic Zero Cardinal Zero Cardinal a => Prod a Zero Cardinal a => Sum a Zero DropList Zero Nil TakeList Zero Nil HeadTail l => Component l Zero (Cardinal Zero, TypeList (:|: e l), DropList Zero l) => DropList Zero (:|: e l) (Cardinal Zero, TypeList (:|: e l), TakeList Zero l) => TakeList Zero (:|: e l) (Cardinal Zero, MultiIndex (:|: i1 is), MultiIndex (:|: i2 is), Ordinal i1, Ordinal i2, Sum i1 i2, MultiIndex is) => MultiIndexConcat Zero (:|: i1 is) (:|: i2 is)

class Cardinal a whereSource

Cardinal number as a type. The associated data type `Succ a` provides the next cardinal type. The method `fromCardinal` provides a numeric representation of the cardinal number; it should be independent on the argument and work on `undefined`.

Associated Types

data Succ a Source

Methods

fromCardinal :: Num i => a -> iSource

Instances

 Cardinal Zero Cardinal a => Cardinal (Succ a)

type C0 = ZeroSource

class Cardinal (Card a) => Cardinality a Source

The cardinality of a type is defined by its `Cardinal` type `Card a`.

Associated Types

type Card a Source

Instances

 Cardinality One Cardinality Nil (Cardinal (Card (Succ n)), Cardinality n) => Cardinality (Succ n) (Cardinal (Card (:|: e l)), Cardinality e, Cardinality l, Cardinal (:*: (Card e) (Card l))) => Cardinality (:|: e l)

card :: (Cardinality a, Num i) => a -> iSource

The numeric cardinality of a type. `card` is independent on its argument.

class GCardinality a Source

Associated Types

type GCard a Source

Instances

 GCardinality (V1 p) GCardinality (U1 p) Cardinality a => GCardinality (K1 i a p) (GCardinality (f p), GCardinality (g p)) => GCardinality (:+: f g p) (GCardinality (f p), GCardinality (g p)) => GCardinality (:*: f g p) GCardinality (f p) => GCardinality (M1 i c f p)