monoid and fold rearranging

This commit is contained in:
Stephen Diehl
2016-12-13 09:14:39 +00:00
parent 0fb7730b0c
commit cc0565112f
4 changed files with 27 additions and 0 deletions
+9
View File
@@ -160,3 +160,12 @@ notElem :: (Foldable t, Eq a) => a -> t a -> Bool
```haskell
find :: Foldable t => (a -> Bool) -> t a -> Maybe a
```
```haskell
foldr1May :: (a -> a -> a) -> [a] -> Maybe a
```
```haskell
foldl1May :: (a -> a -> a) -> [a] -> Maybe a
```
+11
View File
@@ -109,3 +109,14 @@ filter :: (a -> Bool) -> [a] -> [a]
```haskell
replicate :: Int -> a -> [a]
```
Indexing
--------
```haskell
atMay :: [a] -> Int -> Maybe a
```
```haskell
atDef :: a -> [a] -> Int -> a
```
+6
View File
@@ -29,14 +29,20 @@ mconcat :: Monoid a => [a] -> a
Semigroup
---------
#### <>
```haskell
(<>) :: Semigroup a => a -> a -> a
```
#### sconcat
```haskell
sconcat :: Semigroup a => NonEmpty a -> a
```
#### stimes
```haskell
stimes :: (Semigroup a, Integral b) => b -> a -> a
```
+1
View File
@@ -305,6 +305,7 @@ import Data.Function as X (
-- Genericss
import GHC.Generics as X (
Generic(..)
, Generic1
, Rep
, K1(..)
, M1(..)