ivory-0.1.0.3: 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 end > start, 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 start > end, 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.

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.

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

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