HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulevector-0.13.2.0

Data.Vector.Fusion.Stream.Monadic

Synopsis
valuefoldlM' :: Monad m => (a -> b -> m a) -> a -> Stream m b -> m a

Left fold with a strict accumulator and a monadic operator

valueiterateN :: Monad m => Int -> (a -> a) -> a -> Stream m a

O(n) Apply function \max(n - 1, 0) times to an initial value, producing a stream of \max(n, 0) values.

valueiterateNM :: Monad m => Int -> (a -> m a) -> a -> Stream m a

O(n) Apply monadic function \max(n - 1, 0) times to an initial value, producing a stream of \max(n, 0) values.

datadata SPEC

SPEC is used by GHC in the SpecConstr pass in order to inform the compiler when to be particularly aggressive. In particular, it tells GHC to specialize regardless of size or the number of specializations. However, not all loops fall into this category.

Libraries can specify this by using SPEC data type to inform which loops should be aggressively specialized. For example, instead of

loop x where loop arg = ...

write

loop SPEC x where loop !_ arg = ...

There is no semantic difference between SPEC and SPEC2, we just need a type with two constructors lest it is optimised away before SpecConstr.

This type is reexported from GHC.Exts since GHC 9.0 and base-4.15. For compatibility with earlier releases import it from GHC.Internal.Types in ghc-internal package.

datadata Box a

Box monad

Constructors

Instances3Monad, Functor, Applicative
  • Monad BoxDefined in vector-stream-0.1.0.1 · Data.Stream.Monadic
  • Functor BoxDefined in vector-stream-0.1.0.1 · Data.Stream.Monadic
  • Applicative BoxDefined in vector-stream-0.1.0.1 · Data.Stream.Monadic
datadata Step s a where

Result of taking a single step in a stream

Constructors

Instances1Functor
  • Functor (Step s)Defined in vector-stream-0.1.0.1 · Data.Stream.Monadic