on bebdf08 help sign in
24 lines 840 B history raw
1-- |
2-- Module : Streamly.Sink.Types
3-- Copyright : (c) 2019 Composewell Technologies
4-- License : BSD3
5-- Maintainer : harendra.kumar@gmail.com
6-- Stability : experimental
7-- Portability : GHC
9module Streamly.Sink.Types
10 (
11 Sink (..)
12 )
13where
15------------------------------------------------------------------------------
16-- Sink
17------------------------------------------------------------------------------
19-- | A 'Sink' is a special type of 'Foldl' that does not accumulate any value,
20-- but runs only effects. A 'Sink' has no state to maintain therefore can be a
21-- bit more efficient than a 'Foldl' with '()' as the state, especially when
22-- 'Sink's are composed with other operations. A Sink can be upgraded to a
23-- 'Foldl', but a 'Foldl' cannot be converted into a Sink.
24data Sink m a = Sink (a -> m ())