rio-0.1.18.0: A standard library for Haskell

Safe Haskell | Safe
Language | Haskell2010

RIO.List.Partial

Contents

- Basic functions
- Reducing lists (folds)
  - Special folds
- Building lists
  - Scans
- Indexing lists

Description

`List` partial functions. Import as:

    import qualified RIO.List.Partial as L'

Synopsis

- head :: [a] -> a
- last :: [a] -> a
- tail :: [a] -> [a]
- init :: [a] -> [a]
- foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
- foldl1' :: (a -> a -> a) -> [a] -> a
- foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
- maximum :: (Foldable t, Ord a) => t a -> a
- minimum :: (Foldable t, Ord a) => t a -> a
- maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- (!!) :: [a] -> Int -> a

# Basic functions

head :: [a] -> a #

last :: [a] -> a #

tail :: [a] -> [a] #

init :: [a] -> [a] #

# Reducing lists (folds)

foldl1 :: Foldable t => (a -> a -> a) -> t a -> a #

foldl1' :: (a -> a -> a) -> [a] -> a #

foldr1 :: Foldable t => (a -> a -> a) -> t a -> a #

## Special folds

maximum :: (Foldable t, Ord a) => t a -> a #

minimum :: (Foldable t, Ord a) => t a -> a #

maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

# Building lists

## Scans

scanl1 :: (a -> a -> a) -> [a] -> [a] #

scanr1 :: (a -> a -> a) -> [a] -> [a] #

# Indexing lists

(!!) :: [a] -> Int -> a #