Add repeatN to Util

This commit is contained in:
Nathan McCarty 2025-01-20 00:07:50 -05:00
parent fe4a20ade6
commit 12305cc232

View file

@ -13,6 +13,19 @@ import Data.List.Lazy
%default total
```
## Functions
### repeatN
Recursively applies `f` to `seed` N times
```idris
export
repeatN : (times : Nat) -> (f : a -> a) -> (seed : a) -> a
repeatN 0 f seed = seed
repeatN (S times') f seed = repeatN times' f (f seed)
```
## Either
<!-- idris