Hoogle Search
Within LTS Haskell 23.1 (ghc-9.8.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
Finite sequences
The Seq a type represents a finite sequence of values of type a. Sequences generally behave very much like lists.- The class instances for sequences are all based very closely on those for lists.
- Many functions in this module have the same names as functions in the Prelude or in Data.List. In almost all cases, these functions behave analogously. For example, filter filters a sequence in exactly the same way that Prelude.filter filters a list. The only major exception is the lookup function, which is based on the function by that name in Data.IntMap rather than the one in Prelude.
- Sequences support a wider variety of efficient operations than do
lists. Notably, they offer
- Constant-time access to both the front and the rear with <|, |>, viewl, viewr. For recent GHC versions, this can be done more conveniently using the bidirectional patterns Empty, :<|, and :|>. See the detailed explanation in the "Pattern synonyms" section.
- Logarithmic-time concatenation with ><
- Logarithmic-time splitting with splitAt, take and drop
- Logarithmic-time access to any element with lookup, !?, index, insertAt, deleteAt, adjust', and update
- Whereas lists can be either finite or infinite, sequences are
always finite. As a result, a sequence is strict in its length.
Ignoring efficiency, you can imagine that Seq is defined
data Seq a = Empty | a :<| !(Seq a)
This means that many operations on sequences are stricter than those on lists. For example,(1 : undefined) !! 0 = 1
but(1 :<| undefined) `index` 0 = undefined
Detailed performance information
An amortized running time is given for each operation, with <math> referring to the length of the sequence and i being the integral index used by some operations. These bounds hold even in a persistent (shared) setting. Despite sequences being structurally strict from a semantic standpoint, they are in fact implemented using laziness internally. As a result, many operations can be performed incrementally, producing their results as they are demanded. This greatly improves performance in some cases. These functions include- The Functor methods fmap and <$, along with mapWithIndex
- The Applicative methods <*>, *>, and <*
- The zips: zipWith, zip, etc.
- inits, tails
- fromFunction, replicate, intersperse, and cycleTaking
- reverse
- chunksOf
Warning
The size of a Seq must not exceed maxBound::Int. Violation of this condition is not detected and if the size limit is exceeded, the behaviour of the sequence is undefined. This is unlikely to occur in most applications, but some care may be required when using ><, <*>, *>, or >>, particularly repeatedly and particularly in combination with replicate or fromFunction.Implementation
The implementation uses 2-3 finger trees annotated with sizes, as described in section 4.2 of- Ralf Hinze and Ross Paterson, "Finger trees: a simple general-purpose data structure", Journal of Functional Programming 16:2 (2006) pp 197-217.
Sequence :: [YamlValue] -> Anchor -> YamlValueyaml Data.Yaml.Parser No documentation available.
-
No documentation available.
module Text.Regex.TDFA.
Sequence This modules provides RegexMaker and RegexLike instances for using ByteString with the DFA backend (Text.Regex.Lib.WrapDFAEngine and Text.Regex.Lazy.DFAEngineFPS). This module is usually used via import Text.Regex.TDFA. This exports instances of the high level API and the medium level API of compile,execute, and regexec.
module GI.GLib.Structs.
Sequence The Sequence struct is an opaque data type representing a [sequence][glib-Sequences] data type.
-
gi-glib GI.GLib.Structs.Sequence Memory-managed wrapper type.
Sequence :: ManagedPtr Sequence -> Sequencegi-glib GI.GLib.Structs.Sequence No documentation available.
-
math-functions Numeric.Series Infinite series. It's represented as opaque state and step function.
Sequence :: s -> (s -> (a, s)) -> Sequence amath-functions Numeric.Series No documentation available.
type family
Sequence (arg :: t m a) :: m t asingletons-base Control.Monad.Singletons No documentation available.
Page 1 of many | Next