on b9e99db help sign in
31 lines 883 B history raw
1{-# LANGUAGE CPP #-}
2{-# LANGUAGE ExistentialQuantification #-}
3{-# LANGUAGE FlexibleContexts #-}
5-- |
6-- Module : Streamly.Unfold.Types
7-- Copyright : (c) 2019 Composewell Technologies
8-- License : BSD3
9-- Maintainer : harendra.kumar@gmail.com
10-- Stability : experimental
11-- Portability : GHC
13module Streamly.Unfold.Types
14 ( Unfold (..)
15 )
16where
18import Streamly.Streams.StreamD.Type (Step(..))
20------------------------------------------------------------------------------
21-- Monadic Unfolds
22------------------------------------------------------------------------------
24-- | An @Unfold m a b@ is a generator of a stream of values of type @b@ from a
25-- seed of type 'a' in 'Monad' @m@.
26--
27-- @since 0.7.0
29data Unfold m a b =
30 -- | @Unfold step inject@
31 forall s. Unfold (s -> m (Step s b)) (a -> m s)