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

Language | Haskell2010 |

## Synopsis

- breakOut :: GetBreaks eff ~ Break => Ivory eff ()
- upTo :: ANat n => Ix n -> Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff ()
- downTo :: ANat n => Ix n -> Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff ()
- for :: forall eff n a. ANat n => Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff ()
- times :: forall eff n a. ANat n => Ix n -> (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff ()
- arrayMap :: forall eff n a. ANat n => (Ix n -> Ivory (AllowBreak eff) a) -> Ivory eff ()
- forever :: Ivory (AllowBreak eff) () -> Ivory eff ()

# Documentation

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.)