ivory-0.1.0.3: Safe embedded C programming.

Safe HaskellNone
LanguageHaskell2010

Ivory.Language.Array

Synopsis

Documentation

data Ix n Source

Values in the range 0 .. n-1.

Instances

ANat n => Num (Ix n) Source 
ANat n => IvoryExpr (Ix n) Source 
ANat n => IvoryVar (Ix n) Source 
ANat n => IvoryType (Ix n) Source 
ANat n => IvoryOrd (Ix n) Source 
ANat n => IvoryEq (Ix n) Source 
ANat n => IvoryStore (Ix n) Source 
ANat n => IvoryZeroVal (Ix n) Source 
ANat len => IvoryInit (Ix len) Source 
(ANat n, IvoryIntegral to, Default to) => SafeCast (Ix n) to Source 

ixRep :: Type Source

The representation type of a TyIndex, this is fixed to Int32 for the time being.

fromIx :: ANat n => Ix n -> IxRep Source

toIx :: forall a n. (SafeCast a IxRep, ANat n) => a -> Ix n Source

Casting from a bounded Ivory expression to an index. This is safe, although the value may be truncated. Furthermore, indexes are always positive.

ixSize :: forall n. ANat n => Ix n -> Integer Source

The number of elements that an index covers.

arrayLen :: forall s len area n ref. (Num n, ANat len, IvoryArea area, IvoryRef ref) => ref s (Array len area) -> n Source

(!) :: forall s len area ref. (ANat len, IvoryArea area, IvoryRef ref, IvoryExpr (ref s (Array len area)), IvoryExpr (ref s area)) => ref s (Array len area) -> Ix len -> ref s area Source

Array indexing.