HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleparallel-3.3.0.0Haskell2010

Control.Seq

Sequential strategies provide ways to compositionally specify the degree of evaluation of a data type between the extremes of no evaluation and full evaluation. Sequential strategies may be viewed as complementary to the parallel ones (see module Control.Parallel.Strategies).

Contents
  1. The sequential strategy type
  2. Application of sequential strategies
  3. Basic sequential strategies
  4. Sequential strategies for lists
  5. Sequential strategies for foldable data types
  6. Sequential strategies for tuples
Synopsis
  • Packageparallel-3.3.0.0
  • Exports21
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSeq.hs

The sequential strategy type

typetype Strategy a = a -> ()

The type Strategy a is a -> (). Thus, a strategy is a function whose sole purpose it is to evaluate its argument (either in full or in part).

Application of sequential strategies

Basic sequential strategies

Sequential strategies for lists

valueseqListNth :: Int -> Strategy a -> Strategy [a]

Evaluate the nth element of a list (if there is such) according to the given strategy. The spine of the list up to the nth element is evaluated as a side effect.

Sequential strategies for foldable data types

valueseqArray :: Strategy a -> Strategy (Array i a)

Evaluate the elements of an array according to the given strategy. Evaluation of the array bounds may be triggered as a side effect.

Sequential strategies for tuples

Evaluate the components of a tuple according to the given strategies. No guarantee is given as to the order of evaluation.