utility functions

This commit is contained in:
Stephen Diehl
2016-12-10 16:01:47 +00:00
parent 00c2fce11a
commit 6cb17bb94b
8 changed files with 159 additions and 2 deletions
+16
View File
@@ -68,8 +68,24 @@ identity :: a -> a
The identity function maps any value to itself.
#### applyN
Apply a function to a value `n` times.
*Example*:
```haskell
applyN :: Int -> (a -> a) -> a -> a
```
```haskell
> applyN 25 (+2) 0
50
> applyN 3 (1:) []
[1,1,1]
```
Strictness
-----------