mirror of
https://github.com/composewell/streamly.git
synced 2024-09-19 07:29:02 +03:00
Hide modules not finalised for 0.7.0.
- Hides Pipe, FileSystem.FD, FileSystem.File, Time.Units, Time.Clock modules. - Hides transform function from Fold, Prelude modules. - Change examples depending on File api, and do not build FileIOExamples.
This commit is contained in:
parent
ede4e3f059
commit
ea668dc99b
@ -1,7 +1,7 @@
|
||||
import qualified Streamly.Prelude as S
|
||||
import qualified Streamly.Fold as FL
|
||||
import qualified Streamly.Mem.Array as A
|
||||
import qualified Streamly.FileSystem.File as File
|
||||
import qualified Streamly.FileSystem.Handle as Handle
|
||||
|
||||
import Data.Char (ord)
|
||||
import System.Environment (getArgs)
|
||||
|
@ -9,21 +9,24 @@ import System.Environment (getArgs)
|
||||
|
||||
import Streamly
|
||||
import Streamly.String
|
||||
import qualified Streamly.FileSystem.File as File
|
||||
import qualified Streamly.FileSystem.Handle as FH
|
||||
import qualified Streamly.Fold as FL
|
||||
import qualified Streamly.Mem.Array as A
|
||||
import qualified Streamly.Network.Socket as NS
|
||||
import qualified Streamly.Network.Server as NS
|
||||
import qualified Streamly.Prelude as S
|
||||
|
||||
import System.IO (withFile, IOMode(..))
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
file <- fmap head getArgs
|
||||
File.append file
|
||||
withFile file AppendMode
|
||||
(\src -> FH.write src
|
||||
$ encodeChar8Unchecked
|
||||
$ S.concatMap A.read
|
||||
$ S.concatMapBy parallel (flip NS.withSocketS recv)
|
||||
$ NS.connectionsOnAllAddrs 8090
|
||||
$ NS.connectionsOnAllAddrs 8090)
|
||||
|
||||
where
|
||||
|
||||
|
@ -7,10 +7,14 @@ import System.Environment (getArgs)
|
||||
|
||||
import Streamly
|
||||
import qualified Streamly.Prelude as S
|
||||
import qualified Streamly.FileSystem.File as File
|
||||
import qualified Streamly.FileSystem.Handle as FH
|
||||
import qualified Streamly.Network.Client as Client
|
||||
|
||||
import System.IO (withFile, IOMode(..))
|
||||
|
||||
main :: IO ()
|
||||
main =
|
||||
let sendFile = Client.writeArrays (127,0,0,1) 8090 . File.readArrays
|
||||
in getArgs >>= S.drain . parallely . S.mapM sendFile . S.fromList
|
||||
let sendFile file =
|
||||
withFile file ReadMode $ \src ->
|
||||
Client.writeArrays (127, 0, 0, 1) 8090 $ FH.readArrays src
|
||||
in getArgs >>= S.drain . parallely . S.mapM sendFile . S.fromList
|
||||
|
@ -136,7 +136,7 @@ module Streamly.Fold
|
||||
, mapM
|
||||
|
||||
-- ** Mapping
|
||||
, transform
|
||||
--, transform
|
||||
, lmap
|
||||
--, lsequence
|
||||
, lmapM
|
||||
@ -492,9 +492,9 @@ mapM f = sequence . fmap f
|
||||
-- | Apply a transformation on a 'Fold' using a 'Pipe'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE transform #-}
|
||||
transform :: Monad m => Pipe m a b -> Fold m b c -> Fold m a c
|
||||
transform (Pipe pstep1 pstep2 pinitial) (Fold fstep finitial fextract) =
|
||||
{-# INLINE _transform #-}
|
||||
_transform :: Monad m => Pipe m a b -> Fold m b c -> Fold m a c
|
||||
_transform (Pipe pstep1 pstep2 pinitial) (Fold fstep finitial fextract) =
|
||||
Fold step initial extract
|
||||
|
||||
where
|
||||
|
@ -240,7 +240,7 @@ module Streamly.Prelude
|
||||
|
||||
-- * Transformation
|
||||
|
||||
, transform
|
||||
--, transform
|
||||
|
||||
-- ** Mapping
|
||||
-- | In imperative terms a map operation can be considered as a loop over
|
||||
@ -1581,9 +1581,9 @@ toHandle h m = go m
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
-- | Use a 'Pipe' to transform a stream.
|
||||
{-# INLINE transform #-}
|
||||
transform :: (IsStream t, Monad m) => Pipe m a b -> t m a -> t m b
|
||||
transform pipe xs = fromStreamD $ D.transform pipe (toStreamD xs)
|
||||
{-# INLINE _transform #-}
|
||||
_transform :: (IsStream t, Monad m) => Pipe m a b -> t m a -> t m b
|
||||
_transform pipe xs = fromStreamD $ D.transform pipe (toStreamD xs)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Transformation by Folding (Scans)
|
||||
|
@ -204,28 +204,28 @@ library
|
||||
, Streamly.Sink.Types
|
||||
, Streamly.Sink
|
||||
, Streamly.Pipe.Types
|
||||
, Streamly.Pipe
|
||||
|
||||
, Streamly.FileSystem.IOVec
|
||||
, Streamly.FileSystem.FDIO
|
||||
|
||||
exposed-modules: Streamly.Prelude
|
||||
, Streamly.Time
|
||||
, Streamly
|
||||
, Streamly.Fold
|
||||
, Streamly.Pipe
|
||||
|
||||
, Streamly.String
|
||||
|
||||
-- IO devices
|
||||
, Streamly.Mem.Array
|
||||
, Streamly.FileSystem.FD
|
||||
, Streamly.FileSystem.Handle
|
||||
, Streamly.FileSystem.File
|
||||
|
||||
-- Time
|
||||
, Streamly.Time.Units
|
||||
, Streamly.Time.Clock
|
||||
|
||||
exposed-modules: Streamly.Prelude
|
||||
, Streamly.Time
|
||||
, Streamly
|
||||
, Streamly.Fold
|
||||
|
||||
, Streamly.String
|
||||
|
||||
-- IO devices
|
||||
, Streamly.Mem.Array
|
||||
, Streamly.FileSystem.Handle
|
||||
|
||||
, Streamly.Tutorial
|
||||
, Streamly.Internal
|
||||
if !impl(ghcjs)
|
||||
@ -1041,7 +1041,7 @@ executable FileIOExamples
|
||||
hs-source-dirs: examples
|
||||
ghc-options: -Wall
|
||||
if flag(examples) || flag(examples-sdl)
|
||||
buildable: True
|
||||
buildable: False
|
||||
build-Depends:
|
||||
streamly
|
||||
, base >= 4.8 && < 5
|
||||
|
Loading…
Reference in New Issue
Block a user