@@ -11,6 +11,7 @@
12module Streamly.Internal.Data.Fold.Tee
12module Streamly.Internal.Data.Fold.Tee
@@ -24,9 +25,13 @@ import qualified Streamly.Internal.Data.Fold.Type as Fold
24-- instances.
25-- instances.
26newtype Tee m a b =
27newtype Tee m a b =
27− Tee { toFold :: Fold m a b }
28+ Tee { unTee :: Fold m a b }
28 deriving (Functor)
29 deriving (Functor)
31+{-# DEPRECATED toFold "Please use 'unTee' instead." #-}
32+toFold :: Tee m a b -> Fold m a b
30-- | '<*>' distributes the input to both the argument 'Tee's and combines their
35-- | '<*>' distributes the input to both the argument 'Tee's and combines their
31-- outputs using function application.
36-- outputs using function application.
@@ -36,7 +41,7 @@ instance Monad m => Applicative (Tee m a) where
36 pure a = Tee (Fold.fromPure a)
41 pure a = Tee (Fold.fromPure a)
38 {-# INLINE (<*>) #-}
43 {-# INLINE (<*>) #-}
39− (<*>) a b = Tee (Fold.teeWith ($) (toFold a) (toFold b))
44+ (<*>) a b = Tee (Fold.teeWith ($) (unTee a) (unTee b))
41-- | '<>' distributes the input to both the argument 'Tee's and combines their
46-- | '<>' distributes the input to both the argument 'Tee's and combines their
42-- outputs using the 'Semigroup' instance of the output type.
47-- outputs using the 'Semigroup' instance of the output type.