Data.Edison.Seq.ListSeq

EdisonAPI-1.3.1: A library of efficient, purely-functional data structures (API)

Copyright | Copyright (c) 1998 Chris Okasaki
License | MIT; see COPYRIGHT file for terms and conditions
Maintainer | robdockins AT fastmail DOT fm
Stability | stable
Portability | GHC, Hugs (MPTC and FD)
Safe Haskell | Safe
Language | Haskell2010

Data.Edison.Seq.ListSeq

Contents

- Sequence Type
- Sequence Operations
- Unit testing
- Documentation
- Orphan instances

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

- type Seq a = [a]
- empty :: [a]
- singleton :: a -> [a]
- lcons :: a -> [a] -> [a]
- rcons :: a -> [a] -> [a]
- append :: [a] -> [a] -> [a]
- lview :: Monad rm => [a] -> rm (a, [a])
- lhead :: [a] -> a
- lheadM :: Monad rm => [a] -> rm a
- ltail :: [a] -> [a]
- ltailM :: Monad rm => [a] -> rm [a]
- rview :: Monad rm => [a] -> rm (a, [a])
- rhead :: [a] -> a
- rheadM :: Monad rm => [a] -> rm a
- rtail :: [a] -> [a]
- rtailM :: Monad rm => [a] -> rm [a]
- null :: [a] -> Bool
- size :: [a] -> Int
- concat :: [[a]] -> [a]
- reverse :: [a] -> [a]
- reverseOnto :: [a] -> [a] -> [a]
- fromList :: [a] -> [a]
- toList :: [a] -> [a]
- map :: (a -> b) -> [a] -> [b]
- concatMap :: (a -> [b]) -> [a] -> [b]
- fold :: (a -> b -> b) -> b -> [a] -> b
- fold' :: (a -> b -> b) -> b -> [a] -> b
- fold1 :: (a -> a -> a) -> [a] -> a
- fold1' :: (a -> a -> a) -> [a] -> a
- foldr :: (a -> b -> b) -> b -> [a] -> b
- foldr' :: (t -> a -> a) -> a -> [t] -> a
- foldl :: (b -> a -> b) -> b -> [a] -> b
- foldl' :: (b -> a -> b) -> b -> [a] -> b
- foldr1 :: (a -> a -> a) -> [a] -> a
- foldr1' :: (t -> t -> t) -> [t] -> t
- foldl1 :: (a -> a -> a) -> [a] -> a
- foldl1' :: (a -> a -> a) -> [a] -> a
- reducer :: (a -> a -> a) -> a -> [a] -> a
- reducer' :: (a -> a -> a) -> a -> [a] -> a
- reducel :: (a -> a -> a) -> a -> [a] -> a
- reducel' :: (a -> a -> a) -> a -> [a] -> a
- reduce1 :: (a -> a -> a) -> [a] -> a
- reduce1' :: (a -> a -> a) -> [a] -> a
- copy :: Int -> a -> [a]
- inBounds :: Int -> [a] -> Bool
- lookup :: Int -> [a] -> a
- lookupM :: Monad m => Int -> [a] -> m a
- lookupWithDefault :: a -> Int -> [a] -> a
- update :: Int -> a -> [a] -> [a]
- adjust :: (a -> a) -> Int -> [a] -> [a]
- mapWithIndex :: (Int -> a -> b) -> [a] -> [b]
- foldrWithIndex :: (Int -> a -> b -> b) -> b -> [a] -> b
- foldrWithIndex' :: (Num t2, Enum t2) => (t2 -> t1 -> t -> t) -> t -> [t1] -> t
- foldlWithIndex :: (b -> Int -> a -> b) -> b -> [a] -> b
- foldlWithIndex' :: (b -> Int -> a -> b) -> b -> [a] -> b
- take :: Int -> [a] -> [a]
- drop :: Int -> [a] -> [a]
- splitAt :: Int -> [a] -> ([a], [a])
- subseq :: Int -> Int -> [a] -> [a]
- filter :: (a -> Bool) -> [a] -> [a]
- partition :: (a -> Bool) -> [a] -> ([a], [a])
- takeWhile :: (a -> Bool) -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- splitWhile :: (a -> Bool) -> [a] -> ([a], [a])
- zip :: [a] -> [b] -> [(a, b)]
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- unzip :: [(a, b)] -> ([a], [b])
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- unzipWith :: (a -> b) -> (a -> c) -> [a] -> ([b], [c])
- unzipWith3 :: (a -> b) -> (a -> c) -> (a -> d) -> [a] -> ([b], [c], [d])
- strict :: [a] -> [a]
- strictWith :: (a -> b) -> [a] -> [a]
- structuralInvariant :: [a] -> Bool
- moduleName :: String

# Sequence Type

type Seq a = [a] #

# Sequence Operations

empty :: [a] #

singleton :: a -> [a] #

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

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

append :: [a] -> [a] -> [a] #

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

lhead :: [a] -> a #

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

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

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

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

rhead :: [a] -> a #

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

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

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

null :: [a] -> Bool #

size :: [a] -> Int #

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

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

reverseOnto :: [a] -> [a] -> [a] #

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

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

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

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

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

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

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

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

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

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

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

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

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

foldr1' :: (t -> t -> t) -> [t] -> t #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

foldrWithIndex' :: (Num t2, Enum t2) => (t2 -> t1 -> t -> t) -> t -> [t1] -> t #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

strict :: [a] -> [a] #

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

# Unit testing

structuralInvariant :: [a] -> Bool #

# Documentation

moduleName :: String #

# Orphan instances

Sequence [] # |
Methods lcons :: a -> [a] -> [a] # rcons :: a -> [a] -> [a] # fromList :: [a] -> [a] # copy :: Int -> a -> [a] # lview :: Monad m => [a] -> m (a, [a]) # lhead :: [a] -> a # lheadM :: Monad m => [a] -> m a # ltail :: [a] -> [a] # ltailM :: Monad m => [a] -> m [a] # rview :: Monad m => [a] -> m (a, [a]) # rhead :: [a] -> a # rheadM :: Monad m => [a] -> m a # rtail :: [a] -> [a] # rtailM :: Monad m => [a] -> m [a] # null :: [a] -> Bool # size :: [a] -> Int # toList :: [a] -> [a] # concat :: [[a]] -> [a] # reverse :: [a] -> [a] # reverseOnto :: [a] -> [a] -> [a] # fold :: (a -> b -> b) -> b -> [a] -> b # fold' :: (a -> b -> b) -> b -> [a] -> b # fold1 :: (a -> a -> a) -> [a] -> a # fold1' :: (a -> a -> a) -> [a] -> a # foldr :: (a -> b -> b) -> b -> [a] -> b # foldr' :: (a -> b -> b) -> b -> [a] -> b # foldl :: (b -> a -> b) -> b -> [a] -> b # foldl' :: (b -> a -> b) -> b -> [a] -> b # foldr1 :: (a -> a -> a) -> [a] -> a # foldr1' :: (a -> a -> a) -> [a] -> a # foldl1 :: (a -> a -> a) -> [a] -> a # foldl1' :: (a -> a -> a) -> [a] -> a # reducer :: (a -> a -> a) -> a -> [a] -> a # reducer' :: (a -> a -> a) -> a -> [a] -> a # reducel :: (a -> a -> a) -> a -> [a] -> a # reducel' :: (a -> a -> a) -> a -> [a] -> a # reduce1 :: (a -> a -> a) -> [a] -> a # reduce1' :: (a -> a -> a) -> [a] -> a # take :: Int -> [a] -> [a] # drop :: Int -> [a] -> [a] # splitAt :: Int -> [a] -> ([a], [a]) # subseq :: Int -> Int -> [a] -> [a] # filter :: (a -> Bool) -> [a] -> [a] # partition :: (a -> Bool) -> [a] -> ([a], [a]) # takeWhile :: (a -> Bool) -> [a] -> [a] # dropWhile :: (a -> Bool) -> [a] -> [a] # splitWhile :: (a -> Bool) -> [a] -> ([a], [a]) # inBounds :: Int -> [a] -> Bool # lookup :: Int -> [a] -> a # lookupM :: Monad m => Int -> [a] -> m a # lookupWithDefault :: a -> Int -> [a] -> a # update :: Int -> a -> [a] -> [a] # adjust :: (a -> a) -> Int -> [a] -> [a] # mapWithIndex :: (Int -> a -> b) -> [a] -> [b] # foldrWithIndex :: (Int -> a -> b -> b) -> b -> [a] -> b # foldrWithIndex' :: (Int -> a -> b -> b) -> b -> [a] -> b # foldlWithIndex :: (b -> Int -> a -> b) -> b -> [a] -> b # foldlWithIndex' :: (b -> Int -> a -> b) -> b -> [a] -> b # zip :: [a] -> [b] -> [(a, b)] # zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] # zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] # zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] # unzip :: [(a, b)] -> ([a], [b]) # unzip3 :: [(a, b, c)] -> ([a], [b], [c]) # unzipWith :: (a -> b) -> (a -> c) -> [a] -> ([b], [c]) # unzipWith3 :: (a -> b) -> (a -> c) -> (a -> d) -> [a] -> ([b], [c], [d]) # strict :: [a] -> [a] # strictWith :: (a -> b) -> [a] -> [a] # structuralInvariant :: [a] -> Bool # instanceName :: [a] -> String #