Skip to content

Commit a905c91

Browse files
committed
Rename StreamK.hoist to StreamK.morphInner
1 parent a240be5 commit a905c91

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

core/src/Streamly/Internal/Data/StreamK.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,23 @@ module Streamly.Internal.Data.StreamK
117117
, the
118118

119119
-- ** Transforming Inner Monad
120-
, hoist
120+
, morphInner
121121

122122
-- * Exceptions
123123
, handle
124124

125125
-- * Resource Management
126126
, bracketIO
127+
128+
-- * Deprecated
129+
, hoist
127130
)
128131
where
129132

130133
#include "ArrayMacros.h"
131134
#include "inline.hs"
132135
#include "assert.hs"
136+
#include "deprecation.h"
133137

134138
import Control.Exception (mask_, Exception)
135139
import Control.Monad (void, join)
@@ -687,16 +691,17 @@ toList :: Monad m => StreamK m a -> m [a]
687691
toList = foldr (:) []
688692

689693
-- Based on suggestions by David Feuer and Pranay Sashank
690-
{-# INLINE hoist #-}
691-
hoist :: (Monad m, Monad n)
694+
{-# INLINE morphInner #-}
695+
morphInner, hoist :: (Monad m, Monad n)
692696
=> (forall x. m x -> n x) -> StreamK m a -> StreamK n a
693-
hoist f str =
697+
morphInner f str =
694698
mkStream $ \st yld sng stp ->
695699
let single = return . sng
696700
yieldk a s = return $ yld a (hoist f s)
697701
stop = return stp
698702
state = adaptState st
699703
in join . f $ foldStreamShared state yieldk single stop str
704+
RENAME(hoist,morphInner)
700705

701706
-------------------------------------------------------------------------------
702707
-- Transformation by folding (Scans)

0 commit comments

Comments
 (0)