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 | Haskell98 |
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 )
- 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' :: (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
- 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' :: (Enum a1, Num a1) => (a1 -> t -> a -> a) -> a -> [t] -> a
- 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
Sequence Operations
reverseOnto :: [a] -> [a] -> [a] Source
lookupWithDefault :: 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
splitWhile :: (a -> Bool) -> [a] -> ([a], [a]) Source
unzipWith3 :: (a -> b) -> (a -> c) -> (a -> d) -> [a] -> ([b], [c], [d]) Source
strictWith :: (a -> b) -> [a] -> [a] Source
Unit testing
structuralInvariant :: [a] -> Bool Source