Portability | non-portable (TF,GNTD) |
---|---|

Stability | experimental |

Maintainer | hans@hanshoglund.se |

Safe Haskell | None |

- divideList :: Int -> [a] -> [[a]]
- splitWhile :: (a -> Bool) -> [a] -> [[a]]
- breakList :: Int -> [a] -> [a] -> [a]
- mapIndexed :: (Int -> a -> b) -> [a] -> [b]
- dup :: a -> (a, a)
- unf :: (a -> Maybe a) -> a -> [a]
- mapF :: (b -> b) -> [b] -> [b]
- mapT :: (b -> b) -> [b] -> [b]
- mapL :: (b -> b) -> [b] -> [b]
- mapFTL :: (a -> b) -> (a -> b) -> (a -> b) -> [a] -> [b]
- filterOnce :: (a -> Bool) -> [a] -> [a]
- rots :: [a] -> [[a]]
- rotl :: [a] -> [a]
- rotr :: [a] -> [a]
- rotated :: Int -> [a] -> [a]
- curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d
- uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
- untripl :: (a, b, c) -> ((a, b), c)
- tripl :: ((a, b), c) -> (a, b, c)
- tripr :: (a, (b, c)) -> (a, b, c)
- partial2 :: (a -> b -> Bool) -> a -> b -> Maybe b
- partial3 :: (a -> b -> c -> Bool) -> a -> b -> c -> Maybe c
- list :: r -> ([a] -> r) -> [a] -> r
- merge :: Ord a => [a] -> [a] -> [a]
- mergeBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a]
- mergeBy' :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- composed :: [b -> b] -> b -> b
- unRatio :: Integral a => Ratio a -> (a, a)
- showRatio :: (Integral a, Show a) => Ratio a -> String
- retainUpdates :: Eq a => [a] -> [Maybe a]
- replic :: Integral a => a -> b -> [b]
- swap :: (a, b) -> (b, a)
- withNext :: [a] -> [(a, Maybe a)]
- withPrev :: [a] -> [(Maybe a, a)]
- withPrevNext :: [a] -> [(Maybe a, a, Maybe a)]
- mapWithNext :: (a -> Maybe a -> b) -> [a] -> [b]
- mapWithPrev :: (Maybe a -> a -> b) -> [a] -> [b]
- mapWithPrevNext :: (Maybe a -> a -> Maybe a -> b) -> [a] -> [b]
- rotate :: Int -> [a] -> [a]
- toDouble :: Real a => a -> Double
- through :: Applicative f => Lens' s a -> Lens s t a b -> Lens (f s) (f t) (f a) (f b)
- single :: Prism' [a] a
- tripped :: Iso ((a, b), c) ((a', b'), c') (a, b, c) (a', b', c')
- floor' :: RealFrac a => a -> a
- inspecting :: Eq a => (b -> a) -> b -> b -> Bool
- inspectingBy :: (b -> a) -> (a -> a -> Bool) -> b -> b -> Bool

# Documentation

divideList :: Int -> [a] -> [[a]]Source

splitWhile :: (a -> Bool) -> [a] -> [[a]]Source

Group a list into sublists whereever a predicate holds. The matched element is the first in the sublist.

splitWhile isSpace "foo bar baz" ===> ["foo"," bar"," baz"] splitWhile (> 3) [1,5,4,7,0,1,2] ===> [[1],[5],[4],[7,0,1,2]]

category : List depends : base

breakList :: Int -> [a] -> [a] -> [a]Source

Break up a list into parts of maximum length n, inserting the given list as separator.
Useful for breaking up strings, as in `breakList 80 n str`

.

category : List depends : base

mapIndexed :: (Int -> a -> b) -> [a] -> [b]Source

mapFTL :: (a -> b) -> (a -> b) -> (a -> b) -> [a] -> [b]Source

Map over first, middle and last elements of list. Biased on first, then on first and last for short lists.

category: List depends: base

filterOnce :: (a -> Bool) -> [a] -> [a]Source

retainUpdates :: Eq a => [a] -> [Maybe a]Source

withPrevNext :: [a] -> [(Maybe a, a, Maybe a)]Source

mapWithNext :: (a -> Maybe a -> b) -> [a] -> [b]Source

mapWithPrev :: (Maybe a -> a -> b) -> [a] -> [b]Source

mapWithPrevNext :: (Maybe a -> a -> Maybe a -> b) -> [a] -> [b]Source

rotate :: Int -> [a] -> [a]Source

Rotate a list.

rotate n xs == id iff (n `mod` length xs) == 0 rotate (-n) . rotate n == id

inspecting :: Eq a => (b -> a) -> b -> b -> BoolSource

inspectingBy :: (b -> a) -> (a -> a -> Bool) -> b -> b -> BoolSource