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

Language | Haskell2010 |

- 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]
- 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
- floor' :: RealFrac a => a -> a
- inspecting :: Eq a => (b -> a) -> b -> b -> Bool

# Documentation

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

Divide a list into parts of maximum length n. > category : List > depends : base

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

Map over the indices and elements of list. > category : List > depends : base

unf :: (a -> Maybe a) -> a -> [a] Source

Unfold a partial function. This is a simpler version of `unfoldr`

.
> category: Function, List
> depends: base

mapF :: (b -> b) -> [b] -> [b] Source

Map over first elements of a list. Biased on first element for shorter lists. > category: List > depends: base

mapT :: (b -> b) -> [b] -> [b] Source

Map over all but the first and last elements of a list. Biased on middle elements for shorter lists. > category: List > depends: base

mapL :: (b -> b) -> [b] -> [b] Source

Map over last elements of a list. Biased on last element for shorter lists. > category: List > depends: base

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

Extract the first consecutive sublist for which the predicate returns true, or the empty list if no such sublist exists. > category: List > depends: base

Returns all rotations of the given list. Given an infinite list, returns an infinite list of rotated infinite lists. > category: List > depends: base

mergeBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a] Source

Merge lists. > category: List > depends: base

showRatio :: (Integral a, Show a) => Ratio a -> String Source

Nicer printing of ratio as ordinary fractions. > category: Math > depends: base

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

inspecting :: Eq a => (b -> a) -> b -> b -> Bool Source