ivory-0.1.0.9: Safe embedded C programming.

Safe HaskellNone
LanguageHaskell2010

Ivory.Language.Loop

Synopsis

Documentation

breakOut :: GetBreaks eff ~ Break => Ivory eff () Source #

upTo :: ANat n => Ix n -> Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff () Source #

Loop over the range of indexes [start, start + 1 .. end]. If start > end, the loop body will never execute.

downTo :: ANat n => Ix n -> Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff () Source #

Loop over the range of indexes [end, end - 1 .. start]. If end > start, the loop body will never execute.

for :: forall eff n a. ANat n => Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff () Source #

Run the computation n times, where n :: Ix m, 0 <= n <= m. Indexes increment from 0 to n-1 inclusively.

Note: The definition of for may change so that no index value is provided. (Consider using upto if you need to use the index.)

times :: forall eff n a. ANat n => Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff () Source #

Run the computation n times, where n :: Ix m, 0 <= n <= m. Indexes decrement from n-1 to 0 inclusively.

Note: The definition of times may change so that no index value is provided. (Consider using downTo if you need to use the index.)

arrayMap :: forall eff n a. ANat n => (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff () Source #

forever :: Ivory (AllowBreak eff) () -> Ivory eff () Source #