universum-0.3: Custom prelude used in Serokell

Safe HaskellSafe
LanguageHaskell2010

List

Synopsis

Documentation

list :: [b] -> (a -> b) -> [a] -> [b] Source #

ordNub :: Ord a => [a] -> [a] Source #

sortOn :: Ord o => (a -> o) -> [a] -> [a] Source #

unzip :: [(a, b)] -> ([a], [b]) #

unzip transforms a list of pairs into a list of first components and a list of second components.

unzip3 :: [(a, b, c)] -> ([a], [b], [c]) #

The unzip3 function takes a list of triples and returns three lists, analogous to unzip.

whenNotNull :: Applicative f => [a] -> (NonEmpty a -> f ()) -> f () Source #

whenNotNullM :: Monad m => m [a] -> (NonEmpty a -> m ()) -> m () Source #

zip :: [a] -> [b] -> [(a, b)] #

zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.

zip is right-lazy:

zip [] _|_ = []

zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] #

zip3 takes three lists and returns a list of triples, analogous to zip.