comfort-array-0.3: Arrays where the index type is a function of the shape type

Safe HaskellNone
LanguageHaskell98

Data.Array.Comfort.Shape

Synopsis

Documentation

class C sh where Source #

Minimal complete definition

size

Methods

size :: sh -> Int Source #

uncheckedSize :: sh -> Int Source #

Instances
C () Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: () -> Int Source #

uncheckedSize :: () -> Int Source #

C sh => C (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

(Enum n, Bounded n) => C (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => C (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Ix n => C (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => C (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => C (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

(C sh0, C sh1) => C (sh0, sh1) Source #

Row-major composition of two dimensions.

Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: (sh0, sh1) -> Int Source #

uncheckedSize :: (sh0, sh1) -> Int Source #

(C sh0, C sh1) => C (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: (sh0 :+: sh1) -> Int Source #

uncheckedSize :: (sh0 :+: sh1) -> Int Source #

(TriangularPart part, C size) => C (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: Triangular part size -> Int Source #

uncheckedSize :: Triangular part size -> Int Source #

(C sh0, C sh1, C sh2) => C (sh0, sh1, sh2) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: (sh0, sh1, sh2) -> Int Source #

uncheckedSize :: (sh0, sh1, sh2) -> Int Source #

class C sh => Indexed sh where Source #

Minimal complete definition

indices, (sizeOffset | offset), inBounds

Associated Types

type Index sh :: * Source #

Methods

indices :: sh -> [Index sh] Source #

offset :: sh -> Index sh -> Int Source #

uncheckedOffset :: sh -> Index sh -> Int Source #

inBounds :: sh -> Index sh -> Bool Source #

sizeOffset :: sh -> (Int, Index sh -> Int) Source #

uncheckedSizeOffset :: sh -> (Int, Index sh -> Int) Source #

Instances
Indexed () Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index () :: Type Source #

Methods

indices :: () -> [Index ()] Source #

offset :: () -> Index () -> Int Source #

uncheckedOffset :: () -> Index () -> Int Source #

inBounds :: () -> Index () -> Bool Source #

sizeOffset :: () -> (Int, Index () -> Int) Source #

uncheckedSizeOffset :: () -> (Int, Index () -> Int) Source #

C sh => Indexed (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Deferred sh) :: Type Source #

(Enum n, Bounded n) => Indexed (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Enumeration n) :: Type Source #

Integral n => Indexed (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Shifted n) :: Type Source #

Ix n => Indexed (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Range n) :: Type Source #

Integral n => Indexed (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (OneBased n) :: Type Source #

Integral n => Indexed (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (ZeroBased n) :: Type Source #

(Indexed sh0, Indexed sh1) => Indexed (sh0, sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (sh0, sh1) :: Type Source #

Methods

indices :: (sh0, sh1) -> [Index (sh0, sh1)] Source #

offset :: (sh0, sh1) -> Index (sh0, sh1) -> Int Source #

uncheckedOffset :: (sh0, sh1) -> Index (sh0, sh1) -> Int Source #

inBounds :: (sh0, sh1) -> Index (sh0, sh1) -> Bool Source #

sizeOffset :: (sh0, sh1) -> (Int, Index (sh0, sh1) -> Int) Source #

uncheckedSizeOffset :: (sh0, sh1) -> (Int, Index (sh0, sh1) -> Int) Source #

(Indexed sh0, Indexed sh1) => Indexed (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (sh0 :+: sh1) :: Type Source #

Methods

indices :: (sh0 :+: sh1) -> [Index (sh0 :+: sh1)] Source #

offset :: (sh0 :+: sh1) -> Index (sh0 :+: sh1) -> Int Source #

uncheckedOffset :: (sh0 :+: sh1) -> Index (sh0 :+: sh1) -> Int Source #

inBounds :: (sh0 :+: sh1) -> Index (sh0 :+: sh1) -> Bool Source #

sizeOffset :: (sh0 :+: sh1) -> (Int, Index (sh0 :+: sh1) -> Int) Source #

uncheckedSizeOffset :: (sh0 :+: sh1) -> (Int, Index (sh0 :+: sh1) -> Int) Source #

(TriangularPart part, Indexed size) => Indexed (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Triangular part size) :: Type Source #

Methods

indices :: Triangular part size -> [Index (Triangular part size)] Source #

offset :: Triangular part size -> Index (Triangular part size) -> Int Source #

uncheckedOffset :: Triangular part size -> Index (Triangular part size) -> Int Source #

inBounds :: Triangular part size -> Index (Triangular part size) -> Bool Source #

sizeOffset :: Triangular part size -> (Int, Index (Triangular part size) -> Int) Source #

uncheckedSizeOffset :: Triangular part size -> (Int, Index (Triangular part size) -> Int) Source #

(Indexed sh0, Indexed sh1, Indexed sh2) => Indexed (sh0, sh1, sh2) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (sh0, sh1, sh2) :: Type Source #

Methods

indices :: (sh0, sh1, sh2) -> [Index (sh0, sh1, sh2)] Source #

offset :: (sh0, sh1, sh2) -> Index (sh0, sh1, sh2) -> Int Source #

uncheckedOffset :: (sh0, sh1, sh2) -> Index (sh0, sh1, sh2) -> Int Source #

inBounds :: (sh0, sh1, sh2) -> Index (sh0, sh1, sh2) -> Bool Source #

sizeOffset :: (sh0, sh1, sh2) -> (Int, Index (sh0, sh1, sh2) -> Int) Source #

uncheckedSizeOffset :: (sh0, sh1, sh2) -> (Int, Index (sh0, sh1, sh2) -> Int) Source #

class Indexed sh => InvIndexed sh where Source #

Minimal complete definition

indexFromOffset

Methods

indexFromOffset :: sh -> Int -> Index sh Source #

It should hold indexFromOffset sh k == indices sh !! k, but indexFromOffset should generally be faster.

uncheckedIndexFromOffset :: sh -> Int -> Index sh Source #

Instances
InvIndexed () Source # 
Instance details

Defined in Data.Array.Comfort.Shape

C sh => InvIndexed (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

(Enum n, Bounded n) => InvIndexed (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => InvIndexed (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Ix n => InvIndexed (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => InvIndexed (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => InvIndexed (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

(InvIndexed sh0, InvIndexed sh1) => InvIndexed (sh0, sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

indexFromOffset :: (sh0, sh1) -> Int -> Index (sh0, sh1) Source #

uncheckedIndexFromOffset :: (sh0, sh1) -> Int -> Index (sh0, sh1) Source #

(InvIndexed sh0, InvIndexed sh1) => InvIndexed (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

indexFromOffset :: (sh0 :+: sh1) -> Int -> Index (sh0 :+: sh1) Source #

uncheckedIndexFromOffset :: (sh0 :+: sh1) -> Int -> Index (sh0 :+: sh1) Source #

(TriangularPart part, InvIndexed size) => InvIndexed (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

indexFromOffset :: Triangular part size -> Int -> Index (Triangular part size) Source #

uncheckedIndexFromOffset :: Triangular part size -> Int -> Index (Triangular part size) Source #

(InvIndexed sh0, InvIndexed sh1, InvIndexed sh2) => InvIndexed (sh0, sh1, sh2) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

indexFromOffset :: (sh0, sh1, sh2) -> Int -> Index (sh0, sh1, sh2) Source #

uncheckedIndexFromOffset :: (sh0, sh1, sh2) -> Int -> Index (sh0, sh1, sh2) Source #

newtype ZeroBased n Source #

ZeroBased denotes a range starting at zero and has a certain length.

Constructors

ZeroBased 

Fields

Instances
Functor ZeroBased Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

fmap :: (a -> b) -> ZeroBased a -> ZeroBased b #

(<$) :: a -> ZeroBased b -> ZeroBased a #

Applicative ZeroBased Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

pure :: a -> ZeroBased a #

(<*>) :: ZeroBased (a -> b) -> ZeroBased a -> ZeroBased b #

liftA2 :: (a -> b -> c) -> ZeroBased a -> ZeroBased b -> ZeroBased c #

(*>) :: ZeroBased a -> ZeroBased b -> ZeroBased b #

(<*) :: ZeroBased a -> ZeroBased b -> ZeroBased a #

Eq n => Eq (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: ZeroBased n -> ZeroBased n -> Bool #

(/=) :: ZeroBased n -> ZeroBased n -> Bool #

Show n => Show (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Storable n => Storable (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

sizeOf :: ZeroBased n -> Int #

alignment :: ZeroBased n -> Int #

peekElemOff :: Ptr (ZeroBased n) -> Int -> IO (ZeroBased n) #

pokeElemOff :: Ptr (ZeroBased n) -> Int -> ZeroBased n -> IO () #

peekByteOff :: Ptr b -> Int -> IO (ZeroBased n) #

pokeByteOff :: Ptr b -> Int -> ZeroBased n -> IO () #

peek :: Ptr (ZeroBased n) -> IO (ZeroBased n) #

poke :: Ptr (ZeroBased n) -> ZeroBased n -> IO () #

NFData n => NFData (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: ZeroBased n -> () #

Integral n => InvIndexed (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => Indexed (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (ZeroBased n) :: Type Source #

Integral n => C (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (ZeroBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (ZeroBased n) = n

newtype OneBased n Source #

OneBased denotes a range starting at one and has a certain length.

Constructors

OneBased 

Fields

Instances
Functor OneBased Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

fmap :: (a -> b) -> OneBased a -> OneBased b #

(<$) :: a -> OneBased b -> OneBased a #

Applicative OneBased Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

pure :: a -> OneBased a #

(<*>) :: OneBased (a -> b) -> OneBased a -> OneBased b #

liftA2 :: (a -> b -> c) -> OneBased a -> OneBased b -> OneBased c #

(*>) :: OneBased a -> OneBased b -> OneBased b #

(<*) :: OneBased a -> OneBased b -> OneBased a #

Eq n => Eq (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: OneBased n -> OneBased n -> Bool #

(/=) :: OneBased n -> OneBased n -> Bool #

Show n => Show (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> OneBased n -> ShowS #

show :: OneBased n -> String #

showList :: [OneBased n] -> ShowS #

Storable n => Storable (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

sizeOf :: OneBased n -> Int #

alignment :: OneBased n -> Int #

peekElemOff :: Ptr (OneBased n) -> Int -> IO (OneBased n) #

pokeElemOff :: Ptr (OneBased n) -> Int -> OneBased n -> IO () #

peekByteOff :: Ptr b -> Int -> IO (OneBased n) #

pokeByteOff :: Ptr b -> Int -> OneBased n -> IO () #

peek :: Ptr (OneBased n) -> IO (OneBased n) #

poke :: Ptr (OneBased n) -> OneBased n -> IO () #

NFData n => NFData (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: OneBased n -> () #

Integral n => InvIndexed (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => Indexed (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (OneBased n) :: Type Source #

Integral n => C (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (OneBased n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (OneBased n) = n

data Range n Source #

Range denotes an inclusive range like those of the Haskell 98 standard Array type from the array package. E.g. the shape type (Range Int32, Range Int64) is equivalent to the ix type (Int32, Int64) for Arrays.

Constructors

Range 

Fields

Instances
Functor Range Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

fmap :: (a -> b) -> Range a -> Range b #

(<$) :: a -> Range b -> Range a #

Eq n => Eq (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: Range n -> Range n -> Bool #

(/=) :: Range n -> Range n -> Bool #

Show n => Show (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> Range n -> ShowS #

show :: Range n -> String #

showList :: [Range n] -> ShowS #

Storable n => Storable (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

sizeOf :: Range n -> Int #

alignment :: Range n -> Int #

peekElemOff :: Ptr (Range n) -> Int -> IO (Range n) #

pokeElemOff :: Ptr (Range n) -> Int -> Range n -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Range n) #

pokeByteOff :: Ptr b -> Int -> Range n -> IO () #

peek :: Ptr (Range n) -> IO (Range n) #

poke :: Ptr (Range n) -> Range n -> IO () #

NFData n => NFData (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: Range n -> () #

Ix n => InvIndexed (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Ix n => Indexed (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Range n) :: Type Source #

Ix n => C (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Range n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Range n) = n

data Shifted n Source #

Shifted denotes a range defined by the start index and the length.

Constructors

Shifted 
Instances
Functor Shifted Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

fmap :: (a -> b) -> Shifted a -> Shifted b #

(<$) :: a -> Shifted b -> Shifted a #

Eq n => Eq (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: Shifted n -> Shifted n -> Bool #

(/=) :: Shifted n -> Shifted n -> Bool #

Show n => Show (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> Shifted n -> ShowS #

show :: Shifted n -> String #

showList :: [Shifted n] -> ShowS #

Storable n => Storable (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

sizeOf :: Shifted n -> Int #

alignment :: Shifted n -> Int #

peekElemOff :: Ptr (Shifted n) -> Int -> IO (Shifted n) #

pokeElemOff :: Ptr (Shifted n) -> Int -> Shifted n -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Shifted n) #

pokeByteOff :: Ptr b -> Int -> Shifted n -> IO () #

peek :: Ptr (Shifted n) -> IO (Shifted n) #

poke :: Ptr (Shifted n) -> Shifted n -> IO () #

NFData n => NFData (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: Shifted n -> () #

Integral n => InvIndexed (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Integral n => Indexed (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Shifted n) :: Type Source #

Integral n => C (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Shifted n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Shifted n) = n

data Enumeration n Source #

Enumeration denotes a shape of fixed size that is defined by Enum and Bounded methods. For correctness it is necessary that the Enum and Bounded are properly implemented. Automatically derived instances are fine.

Constructors

Enumeration 
Instances
Eq (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Show (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Storable (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

NFData (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: Enumeration n -> () #

(Enum n, Bounded n) => InvIndexed (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

(Enum n, Bounded n) => Indexed (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Enumeration n) :: Type Source #

(Enum n, Bounded n) => C (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Enumeration n) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Enumeration n) = n

newtype Deferred sh Source #

This data type wraps another array shape. Its index type is a wrapped Int. The advantages are: No conversion forth and back Int and Index sh. You can convert once using deferIndex and revealIndex whenever you need your application specific index type. No need for e.g. Storable (Index sh), because Int is already Storable.

Constructors

Deferred sh 
Instances
Eq sh => Eq (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: Deferred sh -> Deferred sh -> Bool #

(/=) :: Deferred sh -> Deferred sh -> Bool #

Show sh => Show (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> Deferred sh -> ShowS #

show :: Deferred sh -> String #

showList :: [Deferred sh] -> ShowS #

NFData sh => NFData (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: Deferred sh -> () #

C sh => InvIndexed (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

C sh => Indexed (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Deferred sh) :: Type Source #

C sh => C (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Deferred sh) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

data DeferredIndex ix Source #

Instances
Eq (DeferredIndex ix) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Show (DeferredIndex ix) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Storable (DeferredIndex ix) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

deferIndex :: (Indexed sh, Index sh ~ ix) => sh -> ix -> DeferredIndex ix Source #

revealIndex :: (InvIndexed sh, Index sh ~ ix) => sh -> DeferredIndex ix -> ix Source #

data sh0 :+: sh1 infixr 5 Source #

Constructors

sh0 :+: sh1 infixr 5 
Instances
(Eq sh0, Eq sh1) => Eq (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: (sh0 :+: sh1) -> (sh0 :+: sh1) -> Bool #

(/=) :: (sh0 :+: sh1) -> (sh0 :+: sh1) -> Bool #

(Show sh0, Show sh1) => Show (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> (sh0 :+: sh1) -> ShowS #

show :: (sh0 :+: sh1) -> String #

showList :: [sh0 :+: sh1] -> ShowS #

(NFData sh0, NFData sh1) => NFData (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: (sh0 :+: sh1) -> () #

(InvIndexed sh0, InvIndexed sh1) => InvIndexed (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

indexFromOffset :: (sh0 :+: sh1) -> Int -> Index (sh0 :+: sh1) Source #

uncheckedIndexFromOffset :: (sh0 :+: sh1) -> Int -> Index (sh0 :+: sh1) Source #

(Indexed sh0, Indexed sh1) => Indexed (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (sh0 :+: sh1) :: Type Source #

Methods

indices :: (sh0 :+: sh1) -> [Index (sh0 :+: sh1)] Source #

offset :: (sh0 :+: sh1) -> Index (sh0 :+: sh1) -> Int Source #

uncheckedOffset :: (sh0 :+: sh1) -> Index (sh0 :+: sh1) -> Int Source #

inBounds :: (sh0 :+: sh1) -> Index (sh0 :+: sh1) -> Bool Source #

sizeOffset :: (sh0 :+: sh1) -> (Int, Index (sh0 :+: sh1) -> Int) Source #

uncheckedSizeOffset :: (sh0 :+: sh1) -> (Int, Index (sh0 :+: sh1) -> Int) Source #

(C sh0, C sh1) => C (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: (sh0 :+: sh1) -> Int Source #

uncheckedSize :: (sh0 :+: sh1) -> Int Source #

type Index (sh0 :+: sh1) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (sh0 :+: sh1) = Either (Index sh0) (Index sh1)

data Triangular part size Source #

Constructors

Triangular 

Fields

Instances
(Eq part, Eq size) => Eq (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: Triangular part size -> Triangular part size -> Bool #

(/=) :: Triangular part size -> Triangular part size -> Bool #

(Show part, Show size) => Show (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> Triangular part size -> ShowS #

show :: Triangular part size -> String #

showList :: [Triangular part size] -> ShowS #

(TriangularPart part, NFData size) => NFData (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

rnf :: Triangular part size -> () #

(TriangularPart part, InvIndexed size) => InvIndexed (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

indexFromOffset :: Triangular part size -> Int -> Index (Triangular part size) Source #

uncheckedIndexFromOffset :: Triangular part size -> Int -> Index (Triangular part size) Source #

(TriangularPart part, Indexed size) => Indexed (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Associated Types

type Index (Triangular part size) :: Type Source #

Methods

indices :: Triangular part size -> [Index (Triangular part size)] Source #

offset :: Triangular part size -> Index (Triangular part size) -> Int Source #

uncheckedOffset :: Triangular part size -> Index (Triangular part size) -> Int Source #

inBounds :: Triangular part size -> Index (Triangular part size) -> Bool Source #

sizeOffset :: Triangular part size -> (Int, Index (Triangular part size) -> Int) Source #

uncheckedSizeOffset :: Triangular part size -> (Int, Index (Triangular part size) -> Int) Source #

(TriangularPart part, C size) => C (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

size :: Triangular part size -> Int Source #

uncheckedSize :: Triangular part size -> Int Source #

type Index (Triangular part size) Source # 
Instance details

Defined in Data.Array.Comfort.Shape

type Index (Triangular part size) = (Index size, Index size)

data Lower Source #

Constructors

Lower 
Instances
Eq Lower Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: Lower -> Lower -> Bool #

(/=) :: Lower -> Lower -> Bool #

Show Lower Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> Lower -> ShowS #

show :: Lower -> String #

showList :: [Lower] -> ShowS #

data Upper Source #

Constructors

Upper 
Instances
Eq Upper Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

(==) :: Upper -> Upper -> Bool #

(/=) :: Upper -> Upper -> Bool #

Show Upper Source # 
Instance details

Defined in Data.Array.Comfort.Shape

Methods

showsPrec :: Int -> Upper -> ShowS #

show :: Upper -> String #

showList :: [Upper] -> ShowS #

triangleRoot :: Floating a => a -> a Source #