@@ -6,11 +6,11 @@ module Main (main) where
66
77import Control.Monad (when )
88import Data.Function ((&) )
9- import Streamly.Prelude ( SerialT )
9+ import Streamly.Data.Stream ( Stream )
1010import System.Environment (getArgs )
1111
1212import qualified Streamly.Data.Fold as Fold
13- import qualified Streamly.Prelude as Stream
13+ import qualified Streamly.Data.Stream as Stream
1414import qualified Streamly.Internal.FileSystem.File as File
1515import qualified Streamly.Internal.Unicode.Stream as Unicode
1616import qualified Streamly.Internal.System.Command as Command
@@ -50,18 +50,18 @@ generateHoogleFile target bd =
5050 , " --haddock-hoogle"
5151 , " --builddir=" ++ bd
5252 ]
53- in Command. toLines Fold. toList cmd & Stream. last
53+ in Command. toLines Fold. toList cmd & Stream. fold Fold. last
5454
5555checkoutAndGenerateHoogleFile :: String -> String -> IO (Maybe String )
5656checkoutAndGenerateHoogleFile target rev = do
5757 step $ unwords [" Generating haddock file for" , rev]
5858 checkoutRevision rev
5959 generateHoogleFile target rev
6060
61- fileToLines :: String -> SerialT IO String
61+ fileToLines :: String -> Stream IO String
6262fileToLines path =
6363 File. toChunks path & Unicode. decodeUtf8Arrays
64- & Stream. splitOn ( == ' \n ' ) Fold. toList
64+ & Stream. foldMany ( Fold. takeEndBy_ ( == ' \n ' ) Fold. toList)
6565
6666main :: IO ()
6767main = do
0 commit comments