EdisonAPI-1.3: A library of efficent, purely-functional data structures (API)

CopyrightCopyright (c) 1998 Chris Okasaki
LicenseMIT; see COPYRIGHT file for terms and conditions
Maintainerrobdockins AT fastmail DOT fm
Stabilitystable
PortabilityGHC, Hugs (MPTC and FD)
Safe HaskellSafe
LanguageHaskell2010

Data.Edison.Seq.ListSeq

Contents

Description

This module packages the standard prelude list type as a sequence. This is the baseline sequence implementation and all methods have the default running times listed in Data.Edison.Seq, except for the following two trivial operations:

  • toList, fromList O( 1 )

Synopsis

Sequence Type

type Seq a = [a] Source

Sequence Operations

empty :: [a] Source

singleton :: a -> [a] Source

lcons :: a -> [a] -> [a] Source

rcons :: a -> [a] -> [a] Source

append :: [a] -> [a] -> [a] Source

lview :: Monad rm => [a] -> rm (a, [a]) Source

lhead :: [a] -> a Source

lheadM :: Monad rm => [a] -> rm a Source

ltail :: [a] -> [a] Source

ltailM :: Monad rm => [a] -> rm [a] Source

rview :: Monad rm => [a] -> rm (a, [a]) Source

rhead :: [a] -> a Source

rheadM :: Monad rm => [a] -> rm a Source

rtail :: [a] -> [a] Source

rtailM :: Monad rm => [a] -> rm [a] Source

null :: [a] -> Bool Source

size :: [a] -> Int Source

concat :: [[a]] -> [a] Source

reverse :: [a] -> [a] Source

reverseOnto :: [a] -> [a] -> [a] Source

fromList :: [a] -> [a] Source

toList :: [a] -> [a] Source

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

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

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

fold' :: (a -> b -> b) -> b -> [a] -> b Source

fold1 :: (a -> a -> a) -> [a] -> a Source

fold1' :: (a -> a -> a) -> [a] -> a Source

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

foldr' :: (t -> a -> a) -> a -> [t] -> a Source

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

foldl' :: (b -> a -> b) -> b -> [a] -> b Source

foldr1 :: (a -> a -> a) -> [a] -> a Source

foldr1' :: (a -> a -> a) -> [a] -> a Source

foldl1 :: (a -> a -> a) -> [a] -> a Source

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

reducer :: (a -> a -> a) -> a -> [a] -> a Source

reducer' :: (a -> a -> a) -> a -> [a] -> a Source

reducel :: (a -> a -> a) -> a -> [a] -> a Source

reducel' :: (a -> a -> a) -> a -> [a] -> a Source

reduce1 :: (a -> a -> a) -> [a] -> a Source

reduce1' :: (a -> a -> a) -> [a] -> a Source

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

inBounds :: Int -> [a] -> Bool Source

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

lookupM :: Monad m => Int -> [a] -> m a Source

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

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

adjust :: (a -> a) -> Int -> [a] -> [a] Source

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

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

foldrWithIndex' :: (Enum a1, Num a1) => (a1 -> t -> a -> a) -> a -> [t] -> a Source

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

foldlWithIndex' :: (b -> Int -> a -> b) -> b -> [a] -> b Source

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

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

splitAt :: Int -> [a] -> ([a], [a]) Source

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

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

partition :: (a -> Bool) -> [a] -> ([a], [a]) Source

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

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

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

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

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

zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] Source

zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] Source

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

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

unzipWith :: (a -> b) -> (a -> c) -> [a] -> ([b], [c]) Source

unzipWith3 :: (a -> b) -> (a -> c) -> (a -> d) -> [a] -> ([b], [c], [d]) Source

strict :: [a] -> [a] Source

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

Unit testing

Documentation