Safe Haskell | None |
---|---|

Language | Haskell2010 |

- data Ix n
- type IxRep = Sint32
- ixRep :: Type
- fromIx :: ANat n => Ix n -> IxRep
- toIx :: forall a n. (SafeCast a IxRep, ANat n) => a -> Ix n
- ixSize :: forall n. ANat n => Ix n -> Integer
- arrayLen :: forall s len area n ref. (Num n, ANat len, IvoryArea area, IvoryRef ref) => ref s (Array len area) -> n
- (!) :: 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

# Documentation

Values in the range `0 .. n-1`

.

ANat n => Bounded (Ix n) Source # | |

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 # | |

The representation type of a `TyIndex`

, this is fixed to `Int32`

for the
time being.

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.