EdisonAPI-1.3.1: A library of efficient, 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' :: (t -> t -> t) -> [t] -> t 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' :: (Num t2, Enum t2) => (t2 -> t1 -> t -> t) -> t -> [t1] -> t 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

Orphan instances

Sequence [] Source # 

Methods

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

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

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

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

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

lhead :: [a] -> a Source #

lheadM :: Monad m => [a] -> m a Source #

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

ltailM :: Monad m => [a] -> m [a] Source #

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

rhead :: [a] -> a Source #

rheadM :: Monad m => [a] -> m a Source #

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

rtailM :: Monad m => [a] -> m [a] Source #

null :: [a] -> Bool Source #

size :: [a] -> Int Source #

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

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

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

reverseOnto :: [a] -> [a] -> [a] 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' :: (a -> b -> b) -> b -> [a] -> b 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 #

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 #

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' :: (Int -> a -> b -> b) -> b -> [a] -> b Source #

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

foldlWithIndex' :: (b -> Int -> a -> b) -> b -> [a] -> b 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 #

structuralInvariant :: [a] -> Bool Source #

instanceName :: [a] -> String Source #