Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data family DataFrame (t :: l) (xs :: [k])
- data SomeDataFrame (t :: l) = (Dimensions ns, ArraySingletons t ns) => SomeDataFrame (DataFrame t ns)
- data DataFrame' (xs :: [k]) (t :: l)
- pattern (:*:) :: forall (xs :: [Type]) (ns :: [Nat]). () => forall (y :: Type) (ys :: [Type]). xs ~ (y ': ys) => DataFrame y ns -> DataFrame ys ns -> DataFrame xs ns
- pattern Z :: forall (xs :: [Type]) (ns :: [Nat]). () => xs ~ '[] => DataFrame xs ns
- type family AllTypes (f :: Type -> Constraint) (ts :: l) :: Constraint where ...
- type family ImplAllows (f :: Type -> Constraint) (ts :: l) (ds :: [Nat]) :: Constraint where ...
- type family ArraySingletons (ts :: l) (ns :: [Nat]) :: Constraint where ...
- type family PrimFrames (ts :: l) (ns :: [Nat]) :: Constraint where ...
- class DataFrameInference (t :: l) where
- inferOrd :: forall t ds. (Ord t, ArraySingleton t ds) => DataFrame t ds -> Evidence (Ord (DataFrame t ds))
- inferNum :: forall t ds. (Num t, ArraySingletons t ds) => DataFrame t ds -> Evidence (Num (DataFrame t ds))
- inferFractional :: forall t ds. (Fractional t, ArraySingleton t ds) => DataFrame t ds -> Evidence (Fractional (DataFrame t ds))
- inferFloating :: forall t ds. (Floating t, ArraySingleton t ds) => DataFrame t ds -> Evidence (Floating (DataFrame t ds))
- inferOrd' :: forall t ds. (Ord t, ArraySingleton t ds) => Evidence (Ord (DataFrame t ds))
- inferNum' :: forall t ds. (Num t, ArraySingletons t ds) => Evidence (Num (DataFrame t ds))
- inferFractional' :: forall t ds. (Fractional t, ArraySingleton t ds) => Evidence (Fractional (DataFrame t ds))
- inferFloating' :: forall t ds. (Floating t, ArraySingleton t ds) => Evidence (Floating (DataFrame t ds))
- inferASing' :: forall t ds. (DataFrameInference t, AllTypes PrimBytes t, Dimensions ds) => Evidence (ArraySingletons t ds)
- inferEq' :: forall t ds. (DataFrameInference t, AllTypes Eq t, ArraySingletons t ds) => Evidence (Eq (DataFrame t ds))
- inferShow' :: forall t ds. (DataFrameInference t, AllTypes Show t, ArraySingletons t ds, Dimensions ds) => Evidence (Show (DataFrame t ds))
- inferPrim' :: forall t ds. (DataFrameInference t, AllTypes PrimBytes t, ArraySingletons t ds, Dimensions ds) => Evidence (PrimFrames t ds)
- inferPrimElem' :: forall t ds. (DataFrameInference t, ArraySingletons t ds, ds ~ (Head ds ': Tail ds)) => Evidence (AllTypes PrimBytes t)
- ixOff :: PrimArray t a => Int -> a -> t
- unsafeFromFlatList :: PrimArray t a => Int -> [t] -> a
- class Dim1 (t :: [k] -> Type) (ds :: [k]) where
- class Dim2 (t :: [k] -> Type) (ds :: [k]) where
- class Dim3 (t :: [k] -> Type) (ds :: [k]) where
- dimSize1 :: Dim1 t ds => t ds -> Word
- dimSize2 :: Dim2 t ds => t ds -> Word
- dimSize3 :: Dim3 t ds => t ds -> Word
- bSizeOf :: PrimBytes a => a -> Int
- bAlignOf :: PrimBytes a => a -> Int
- data Dim (x :: k) :: forall k. k -> * where
- pattern D :: forall (n :: Nat). () => KnownDim n => Dim n
- pattern Dim :: forall k (n :: k). () => KnownDim n => Dim n
- pattern Dx :: forall (xn :: XNat). KnownXNatType xn => forall (n :: Nat) (m :: Nat). (KnownDim n, MinDim m n, xn ~ XN m) => Dim n -> Dim xn
- pattern Dn :: forall (xn :: XNat). KnownXNatType xn => forall (n :: Nat). (KnownDim n, xn ~ N n) => Dim n -> Dim xn
- newtype Idx (n :: k) :: forall k. k -> * = Idx {}
- data XNat
- type Dims (xs :: [k]) = TypedList (Dim :: k -> *) xs
- type Idxs (xs :: [k]) = TypedList (Idx :: k -> *) xs
- data TypedList (f :: k -> Type) (xs :: [k]) :: forall k. (k -> Type) -> [k] -> * where
- pattern Empty :: forall k (f :: k -> Type) (xs :: [k]). () => xs ~ ([] :: [k]) => TypedList f xs
- pattern Reverse :: forall k (f :: k -> Type) (xs :: [k]). () => forall (sx :: [k]). (xs ~ Reverse sx, sx ~ Reverse xs) => TypedList f sx -> TypedList f xs
- pattern Snoc :: forall k (f :: k -> Type) (xs :: [k]). () => forall (sy :: [k]) (y :: k). xs ~ (sy +: y) => TypedList f sy -> f y -> TypedList f xs
- pattern Cons :: forall k (f :: k -> Type) (xs :: [k]). () => forall (y :: k) (ys :: [k]). xs ~ (y ': ys) => f y -> TypedList f ys -> TypedList f xs
- pattern TypeList :: forall k (xs :: [k]). () => RepresentableList xs => TypeList xs
- pattern (:*) :: forall k (f :: k -> Type) (xs :: [k]). () => forall (y :: k) (ys :: [k]). xs ~ (y ': ys) => f y -> TypedList f ys -> TypedList f xs
- pattern U :: forall k (f :: k -> Type) (xs :: [k]). () => xs ~ ([] :: [k]) => TypedList f xs
- pattern AsXDims :: forall (ns :: [Nat]). () => (KnownXNatTypes (AsXDims ns), RepresentableList (AsXDims ns)) => Dims (AsXDims ns) -> Dims ns
- pattern Dims :: forall k (ds :: [k]). () => Dimensions ds => Dims ds
- pattern XDims :: forall (xns :: [XNat]). KnownXNatTypes xns => forall (ns :: [Nat]). (FixedDims xns ns, Dimensions ns) => Dims ns -> Dims xns
- pattern KnownDims :: forall k (ds :: [k]). () => (All (KnownDim :: k -> Constraint) ds, Dimensions ds) => Dims ds
Data types
data family DataFrame (t :: l) (xs :: [k]) Source #
Keep data in a primitive data frame and maintain information about Dimensions in the type system
Instances
data SomeDataFrame (t :: l) Source #
Data frame that has an unknown dimensionality at compile time. Pattern-match against its constructor to get a Nat-indexed data frame
(Dimensions ns, ArraySingletons t ns) => SomeDataFrame (DataFrame t ns) |
Instances
(AllTypes Eq t, DataFrameInference t) => Eq (SomeDataFrame t) Source # | |
Defined in Numeric.DataFrame.Type (==) :: SomeDataFrame t -> SomeDataFrame t -> Bool # (/=) :: SomeDataFrame t -> SomeDataFrame t -> Bool # | |
(AllTypes Show t, DataFrameInference t) => Show (SomeDataFrame t) Source # | |
Defined in Numeric.DataFrame.Type showsPrec :: Int -> SomeDataFrame t -> ShowS # show :: SomeDataFrame t -> String # showList :: [SomeDataFrame t] -> ShowS # |
data DataFrame' (xs :: [k]) (t :: l) Source #
DataFrame with its type arguments swapped.
pattern (:*:) :: forall (xs :: [Type]) (ns :: [Nat]). () => forall (y :: Type) (ys :: [Type]). xs ~ (y ': ys) => DataFrame y ns -> DataFrame ys ns -> DataFrame xs ns infixr 6 Source #
Constructing a MultiFrame
using DataFrame columns
pattern Z :: forall (xs :: [Type]) (ns :: [Nat]). () => xs ~ '[] => DataFrame xs ns Source #
Empty MultiFrame
Infer type class instances
type family AllTypes (f :: Type -> Constraint) (ts :: l) :: Constraint where ... Source #
type family ImplAllows (f :: Type -> Constraint) (ts :: l) (ds :: [Nat]) :: Constraint where ... Source #
ImplAllows f (t :: Type) ds = f (Array t ds) | |
ImplAllows _ ('[] :: [Type]) _ = () | |
ImplAllows f (t ': ts :: [Type]) ds = (f (Array t ds), ImplAllows f ts ds) |
type family ArraySingletons (ts :: l) (ns :: [Nat]) :: Constraint where ... Source #
ArraySingletons (t :: Type) ns = ArraySingleton t ns | |
ArraySingletons ('[] :: [Type]) _ = () | |
ArraySingletons (t ': ts :: [Type]) ns = (ArraySingleton t ns, ArraySingletons ts ns) |
type family PrimFrames (ts :: l) (ns :: [Nat]) :: Constraint where ... Source #
PrimFrames (t :: Type) ns = (PrimBytes (DataFrame t ns), PrimArray t (DataFrame t ns)) | |
PrimFrames ('[] :: [Type]) _ = () | |
PrimFrames (t ': ts :: [Type]) ns = (PrimBytes (DataFrame t ns), PrimArray t (DataFrame t ns), PrimFrames ts ns) |
class DataFrameInference (t :: l) where Source #
inferASing :: (AllTypes PrimBytes t, Dimensions ds) => DataFrame t ds -> Evidence (ArraySingletons t ds) Source #
Bring an evidence of ArraySingleton
instance into
a scope at runtime.
This is often used to let GHC infer other complex type class instances,
such as SubSpace
.
inferEq :: (AllTypes Eq t, ArraySingletons t ds) => DataFrame t ds -> Evidence (Eq (DataFrame t ds)) Source #
inferShow :: (AllTypes Show t, ArraySingletons t ds, Dimensions ds) => DataFrame t ds -> Evidence (Show (DataFrame t ds)) Source #
inferPrim :: (AllTypes PrimBytes t, ArraySingletons t ds, Dimensions ds) => DataFrame t ds -> Evidence (PrimFrames t ds) Source #
inferPrimElem :: (ArraySingletons t ds, ds ~ (Head ds ': Tail ds)) => DataFrame t ds -> Evidence (AllTypes PrimBytes t) Source #
This is a special function, because Scalar does not require PrimBytes. That is why the dimension list in the argument nust not be empty.
Instances
inferOrd :: forall t ds. (Ord t, ArraySingleton t ds) => DataFrame t ds -> Evidence (Ord (DataFrame t ds)) Source #
inferNum :: forall t ds. (Num t, ArraySingletons t ds) => DataFrame t ds -> Evidence (Num (DataFrame t ds)) Source #
inferFractional :: forall t ds. (Fractional t, ArraySingleton t ds) => DataFrame t ds -> Evidence (Fractional (DataFrame t ds)) Source #
inferFloating :: forall t ds. (Floating t, ArraySingleton t ds) => DataFrame t ds -> Evidence (Floating (DataFrame t ds)) Source #
inferFractional' :: forall t ds. (Fractional t, ArraySingleton t ds) => Evidence (Fractional (DataFrame t ds)) Source #
inferFloating' :: forall t ds. (Floating t, ArraySingleton t ds) => Evidence (Floating (DataFrame t ds)) Source #
inferASing' :: forall t ds. (DataFrameInference t, AllTypes PrimBytes t, Dimensions ds) => Evidence (ArraySingletons t ds) Source #
inferEq' :: forall t ds. (DataFrameInference t, AllTypes Eq t, ArraySingletons t ds) => Evidence (Eq (DataFrame t ds)) Source #
inferShow' :: forall t ds. (DataFrameInference t, AllTypes Show t, ArraySingletons t ds, Dimensions ds) => Evidence (Show (DataFrame t ds)) Source #
inferPrim' :: forall t ds. (DataFrameInference t, AllTypes PrimBytes t, ArraySingletons t ds, Dimensions ds) => Evidence (PrimFrames t ds) Source #
inferPrimElem' :: forall t ds. (DataFrameInference t, ArraySingletons t ds, ds ~ (Head ds ': Tail ds)) => Evidence (AllTypes PrimBytes t) Source #
Misc
unsafeFromFlatList :: PrimArray t a => Int -> [t] -> a Source #
Construct an array from a flat list and length
Re-exports from dimensions
data Dim (x :: k) :: forall k. k -> * where #
Singleton type to store type-level dimension value.
On the one hand, it can be used to let type-inference system know
relations between type-level naturals.
On the other hand, this is just a newtype wrapper on the Word
type.
Usually, the type parameter of Dim
is either Nat
or XNat
.
If dimensionality of your data is known in advance, use Nat
;
if you know the size of some dimensions, but do not know the size
of others, use XNat
s to represent them.
pattern D :: forall (n :: Nat). () => KnownDim n => Dim n | Same as |
pattern Dim :: forall k (n :: k). () => KnownDim n => Dim n | Independently of the kind of type-level number,
construct an instance of Match against this pattern to bring |
pattern Dx :: forall (xn :: XNat). KnownXNatType xn => forall (n :: Nat) (m :: Nat). (KnownDim n, MinDim m n, xn ~ XN m) => Dim n -> Dim xn |
|
pattern Dn :: forall (xn :: XNat). KnownXNatType xn => forall (n :: Nat). (KnownDim n, xn ~ N n) => Dim n -> Dim xn | Statically known |
Instances
Dim3 (TypedList (Dim :: k -> *) :: [k] -> *) (d1 ': (d2 ': (d3 ': ds)) :: [k]) Source # | |
Dim2 (TypedList (Dim :: k -> *) :: [k] -> *) (d1 ': (d2 ': ds) :: [k]) Source # | |
Dim1 (TypedList (Dim :: k -> *) :: [k] -> *) (d ': ds :: [k]) Source # | |
Eq (Dim n) | |
Eq (Dim x) | |
Ord (Dim n) | |
Ord (Dim x) | |
KnownDim m => Read (Dim (XN m)) | |
Show (Dim x) | |
newtype Idx (n :: k) :: forall k. k -> * #
This type is used to index a single dimension;
the range of indices is from 1
to n
.
Note, this type has a weird Enum
instance:
>>>
fromEnum (Idx 7)
6
The logic behind this is that the Enum
class is used to transform
indices to offsets. That is, element of an array at index k :: Idx n
is the element taken by an offset `k - 1 :: Int`.
Instances
Generic1 (Idx :: k -> *) | |
KnownDim n => Bounded (Idx n) | |
Dimensions ds => Bounded (Idxs ds) | |
KnownDim n => Enum (Idx n) | |
Defined in Numeric.Dimensions.Idxs | |
Dimensions ds => Enum (Idxs ds) | |
Eq (Idx n) | |
Eq (Idxs xs) | |
KnownDim n => Integral (Idx n) | |
(Typeable n, Typeable k) => Data (Idx n) | |
Defined in Numeric.Dimensions.Idxs gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Idx n -> c (Idx n) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Idx n) # dataTypeOf :: Idx n -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Idx n)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Idx n)) # gmapT :: (forall b. Data b => b -> b) -> Idx n -> Idx n # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Idx n -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Idx n -> r # gmapQ :: (forall d. Data d => d -> u) -> Idx n -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Idx n -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Idx n -> m (Idx n) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Idx n -> m (Idx n) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Idx n -> m (Idx n) # | |
KnownDim n => Num (Idx n) | |
KnownDim n => Num (Idxs (n ': ([] :: [k]))) | With this instance we can slightly reduce indexing expressions, e.g. x ! (1 :* 2 :* 4) == x ! (1 :* 2 :* 4 :* U) |
Defined in Numeric.Dimensions.Idxs (+) :: Idxs (n ': []) -> Idxs (n ': []) -> Idxs (n ': []) # (-) :: Idxs (n ': []) -> Idxs (n ': []) -> Idxs (n ': []) # (*) :: Idxs (n ': []) -> Idxs (n ': []) -> Idxs (n ': []) # negate :: Idxs (n ': []) -> Idxs (n ': []) # abs :: Idxs (n ': []) -> Idxs (n ': []) # signum :: Idxs (n ': []) -> Idxs (n ': []) # fromInteger :: Integer -> Idxs (n ': []) # | |
Ord (Idx n) | |
Ord (Idxs xs) | Compare indices by their importance in lexicorgaphic order
from the last dimension to the first dimension
(the last dimension is the most significant one) Literally, compare a b = compare (reverse $ listIdxs a) (reverse $ listIdxs b) This is the same sort == sortOn fromEnum |
Read (Idx n) | |
KnownDim n => Real (Idx n) | |
Defined in Numeric.Dimensions.Idxs toRational :: Idx n -> Rational # | |
Show (Idx n) | |
Show (Idxs xs) | |
Generic (Idx n) | |
Storable (Idx n) | |
PrimBytes (Idx x) Source # | |
Defined in Numeric.PrimBytes getBytes :: Idx x -> ByteArray# Source # fromBytes :: Int# -> ByteArray# -> Idx x Source # readBytes :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Idx x#) Source # writeBytes :: MutableByteArray# s -> Int# -> Idx x -> State# s -> State# s Source # readAddr :: Addr# -> State# s -> (#State# s, Idx x#) Source # writeAddr :: Idx x -> Addr# -> State# s -> State# s Source # byteSize :: Idx x -> Int# Source # byteAlign :: Idx x -> Int# Source # byteOffset :: Idx x -> Int# Source # indexArray :: ByteArray# -> Int# -> Idx x Source # readArray :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Idx x#) Source # writeArray :: MutableByteArray# s -> Int# -> Idx x -> State# s -> State# s Source # | |
RepresentableList xs => PrimBytes (Idxs xs) Source # | |
Defined in Numeric.PrimBytes getBytes :: Idxs xs -> ByteArray# Source # fromBytes :: Int# -> ByteArray# -> Idxs xs Source # readBytes :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Idxs xs#) Source # writeBytes :: MutableByteArray# s -> Int# -> Idxs xs -> State# s -> State# s Source # readAddr :: Addr# -> State# s -> (#State# s, Idxs xs#) Source # writeAddr :: Idxs xs -> Addr# -> State# s -> State# s Source # byteSize :: Idxs xs -> Int# Source # byteAlign :: Idxs xs -> Int# Source # byteOffset :: Idxs xs -> Int# Source # indexArray :: ByteArray# -> Int# -> Idxs xs Source # readArray :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Idxs xs#) Source # writeArray :: MutableByteArray# s -> Int# -> Idxs xs -> State# s -> State# s Source # | |
type Rep1 (Idx :: k -> *) | |
Defined in Numeric.Dimensions.Idxs | |
type Rep (Idx n) | |
Defined in Numeric.Dimensions.Idxs |
Either known or unknown at compile-time natural number
Instances
KnownDimKind XNat | |
Defined in Numeric.Dim | |
DataFrameToList t (xns :: [XNat]) (xz :: XNat) Source # | |
MatrixTranspose (t :: Type) (xn :: XNat) (xm :: XNat) Source # | |
KnownDim n => KnownDim (N n :: XNat) | |
Defined in Numeric.Dim | |
Dim3 (DataFrame l2 :: [XNat] -> *) (d1 ': (d2 ': (d3 ': ds)) :: [XNat]) Source # | |
Dim2 (DataFrame l2 :: [XNat] -> *) (d1 ': (d2 ': ds) :: [XNat]) Source # | |
Dim1 (DataFrame l2 :: [XNat] -> *) (d ': ds :: [XNat]) Source # | |
Eq (Dim x) | |
Ord (Dim x) | |
KnownDim m => Read (Dim (XN m)) | |
(AllTypes Eq t, DataFrameInference t) => Eq (DataFrame t ds) # | |
(AllTypes Show t, DataFrameInference t) => Show (DataFrame t xns) # | |
data STDataFrame s t (xs :: [XNat]) Source # | Data frame with some dimensions missing at compile time. Pattern-match against its constructor to get a Nat-indexed mutable data frame. |
Defined in Numeric.DataFrame.ST | |
data IODataFrame t (xs :: [XNat]) Source # | Data frame with some dimensions missing at compile time. Pattern-match against its constructor to get a Nat-indexed mutable data frame. |
Defined in Numeric.DataFrame.IO | |
data DataFrame (ts :: l) (xns :: [XNat]) Source # | Data frame with some dimensions missing at compile time. Pattern-match against its constructor to get a Nat-indexed data frame. |
Defined in Numeric.DataFrame.Type |
type Idxs (xs :: [k]) = TypedList (Idx :: k -> *) xs #
Type-level dimensional indexing with arbitrary Word values inside.
Most of the operations on it require Dimensions
constraint,
because the Idxs
itself does not store info about dimension bounds.
Note, this type has a special Enum
instance:
fromEnum
gives an offset of the index in a flat 1D array;
this is in line with a weird Enum
instance of Idx
type.
data TypedList (f :: k -> Type) (xs :: [k]) :: forall k. (k -> Type) -> [k] -> * where #
Type-indexed list
pattern Empty :: forall k (f :: k -> Type) (xs :: [k]). () => xs ~ ([] :: [k]) => TypedList f xs | Zero-length type list; synonym to |
pattern Reverse :: forall k (f :: k -> Type) (xs :: [k]). () => forall (sx :: [k]). (xs ~ Reverse sx, sx ~ Reverse xs) => TypedList f sx -> TypedList f xs | Reverse a typed list |
pattern Snoc :: forall k (f :: k -> Type) (xs :: [k]). () => forall (sy :: [k]) (y :: k). xs ~ (sy +: y) => TypedList f sy -> f y -> TypedList f xs | Constructing a type-indexed list from the other end |
pattern Cons :: forall k (f :: k -> Type) (xs :: [k]). () => forall (y :: k) (ys :: [k]). xs ~ (y ': ys) => f y -> TypedList f ys -> TypedList f xs | Constructing a type-indexed list in the canonical way |
pattern TypeList :: forall k (xs :: [k]). () => RepresentableList xs => TypeList xs | Pattern matching against this causes |
pattern (:*) :: forall k (f :: k -> Type) (xs :: [k]). () => forall (y :: k) (ys :: [k]). xs ~ (y ': ys) => f y -> TypedList f ys -> TypedList f xs infixr 5 | Constructing a type-indexed list |
pattern U :: forall k (f :: k -> Type) (xs :: [k]). () => xs ~ ([] :: [k]) => TypedList f xs | Zero-length type list |
pattern AsXDims :: forall (ns :: [Nat]). () => (KnownXNatTypes (AsXDims ns), RepresentableList (AsXDims ns)) => Dims (AsXDims ns) -> Dims ns | An easy way to convert Nat-indexed dims into XNat-indexed dims. |
pattern Dims :: forall k (ds :: [k]). () => Dimensions ds => Dims ds |
|
pattern XDims :: forall (xns :: [XNat]). KnownXNatTypes xns => forall (ns :: [Nat]). (FixedDims xns ns, Dimensions ns) => Dims ns -> Dims xns | Pattern-matching against this constructor reveals Nat-kinded list of dims,
pretending the dimensionality is known at compile time within the scope
of the pattern match.
This is the main recommended way to get In order to use this pattern, one must know |
pattern KnownDims :: forall k (ds :: [k]). () => (All (KnownDim :: k -> Constraint) ds, Dimensions ds) => Dims ds |
|
Instances
Dim3 (TypedList (Dim :: k -> *) :: [k] -> *) (d1 ': (d2 ': (d3 ': ds)) :: [k]) Source # | |
Dim2 (TypedList (Dim :: k -> *) :: [k] -> *) (d1 ': (d2 ': ds) :: [k]) Source # | |
Dim1 (TypedList (Dim :: k -> *) :: [k] -> *) (d ': ds :: [k]) Source # | |
(RepresentableList xs, All Bounded xs) => Bounded (Tuple xs) | |
(RepresentableList xs, All Bounded xs) => Bounded (Tuple xs) | |
All Eq xs => Eq (Tuple xs) | |
All Eq xs => Eq (Tuple xs) | |
(All Eq xs, All Ord xs) => Ord (Tuple xs) | Ord instance of the Tuple implements inverse lexicorgaphic ordering. That is, the last element in the tuple is the most significant one. Note, this will never work on infinite-dimensional tuples! |
Defined in Numeric.Tuple.Lazy | |
(All Eq xs, All Ord xs) => Ord (Tuple xs) | Ord instance of the Tuple implements inverse lexicorgaphic ordering. That is, the last element in the tuple is the most significant one. Note, this will never work on infinite-dimensional tuples! |
Defined in Numeric.Tuple.Strict | |
(RepresentableList xs, All Read xs) => Read (Tuple xs) | |
(RepresentableList xs, All Read xs) => Read (Tuple xs) | |
All Show xs => Show (Tuple xs) | |
All Show xs => Show (Tuple xs) | |
All Semigroup xs => Semigroup (Tuple xs) | |
All Semigroup xs => Semigroup (Tuple xs) | |
(Semigroup (Tuple xs), RepresentableList xs, All Monoid xs) => Monoid (Tuple xs) | |
(Semigroup (Tuple xs), RepresentableList xs, All Monoid xs) => Monoid (Tuple xs) | |
(RepresentableList xs, All PrimBytes xs) => PrimBytes (Tuple xs) Source # | |
Defined in Numeric.PrimBytes getBytes :: Tuple xs -> ByteArray# Source # fromBytes :: Int# -> ByteArray# -> Tuple xs Source # readBytes :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Tuple xs#) Source # writeBytes :: MutableByteArray# s -> Int# -> Tuple xs -> State# s -> State# s Source # readAddr :: Addr# -> State# s -> (#State# s, Tuple xs#) Source # writeAddr :: Tuple xs -> Addr# -> State# s -> State# s Source # byteSize :: Tuple xs -> Int# Source # byteAlign :: Tuple xs -> Int# Source # byteOffset :: Tuple xs -> Int# Source # indexArray :: ByteArray# -> Int# -> Tuple xs Source # readArray :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Tuple xs#) Source # writeArray :: MutableByteArray# s -> Int# -> Tuple xs -> State# s -> State# s Source # | |
(RepresentableList xs, All PrimBytes xs) => PrimBytes (Tuple xs) Source # | |
Defined in Numeric.PrimBytes getBytes :: Tuple xs -> ByteArray# Source # fromBytes :: Int# -> ByteArray# -> Tuple xs Source # readBytes :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Tuple xs#) Source # writeBytes :: MutableByteArray# s -> Int# -> Tuple xs -> State# s -> State# s Source # readAddr :: Addr# -> State# s -> (#State# s, Tuple xs#) Source # writeAddr :: Tuple xs -> Addr# -> State# s -> State# s Source # byteSize :: Tuple xs -> Int# Source # byteAlign :: Tuple xs -> Int# Source # byteOffset :: Tuple xs -> Int# Source # indexArray :: ByteArray# -> Int# -> Tuple xs Source # readArray :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Tuple xs#) Source # writeArray :: MutableByteArray# s -> Int# -> Tuple xs -> State# s -> State# s Source # | |
Dimensions ds => Bounded (Idxs ds) | |
Dimensions ds => Enum (Idxs ds) | |
Eq (Idxs xs) | |
KnownDim n => Num (Idxs (n ': ([] :: [k]))) | With this instance we can slightly reduce indexing expressions, e.g. x ! (1 :* 2 :* 4) == x ! (1 :* 2 :* 4 :* U) |
Defined in Numeric.Dimensions.Idxs (+) :: Idxs (n ': []) -> Idxs (n ': []) -> Idxs (n ': []) # (-) :: Idxs (n ': []) -> Idxs (n ': []) -> Idxs (n ': []) # (*) :: Idxs (n ': []) -> Idxs (n ': []) -> Idxs (n ': []) # negate :: Idxs (n ': []) -> Idxs (n ': []) # abs :: Idxs (n ': []) -> Idxs (n ': []) # signum :: Idxs (n ': []) -> Idxs (n ': []) # fromInteger :: Integer -> Idxs (n ': []) # | |
Ord (Idxs xs) | Compare indices by their importance in lexicorgaphic order
from the last dimension to the first dimension
(the last dimension is the most significant one) Literally, compare a b = compare (reverse $ listIdxs a) (reverse $ listIdxs b) This is the same sort == sortOn fromEnum |
Show (Idxs xs) | |
RepresentableList xs => PrimBytes (Idxs xs) Source # | |
Defined in Numeric.PrimBytes getBytes :: Idxs xs -> ByteArray# Source # fromBytes :: Int# -> ByteArray# -> Idxs xs Source # readBytes :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Idxs xs#) Source # writeBytes :: MutableByteArray# s -> Int# -> Idxs xs -> State# s -> State# s Source # readAddr :: Addr# -> State# s -> (#State# s, Idxs xs#) Source # writeAddr :: Idxs xs -> Addr# -> State# s -> State# s Source # byteSize :: Idxs xs -> Int# Source # byteAlign :: Idxs xs -> Int# Source # byteOffset :: Idxs xs -> Int# Source # indexArray :: ByteArray# -> Int# -> Idxs xs Source # readArray :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Idxs xs#) Source # writeArray :: MutableByteArray# s -> Int# -> Idxs xs -> State# s -> State# s Source # |