HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleunicode-data-0.9.0Haskell2010

Unicode.Internal.Unfold

  • 2 types
  • 1 value
datadata Unfold a b
#

An Unfold a b is a generator of a stream of values of type b from a seed of type a.

Constructors

datadata Step s a
#

A stream is a succession of Steps.

Constructors

  • Yield !a !s

    Produces a single value and the next state of the stream.

  • Stop

    Indicates there are no more values in the stream.

Instances1Functor
  • Functor (Step s)Defined in unicode-data-0.9.0 · Unicode.Internal.Unfold
valuetoList :: Unfold a a -> a -> [a]
#

Convert an 'Unfold a a' to a list [a], if the resulting list is empty the seed is used as a default output.