Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
socket System.Socket.Family.Inet 0.0.0.0
-
socket System.Socket.Family.Inet6 ::
TooManyBytes :: StaticBytesExceptionstatic-bytes Data.StaticBytes No documentation available.
tooManyBytes :: Int -> Int -> String -> IO voidstore-core Data.Store.Core Throws a PeekException about an attempt to read too many bytes.
many :: forall (m :: Type -> Type) a b c . Monad m => Fold m a b -> Fold m b c -> Fold m a cstreamly-core Streamly.Data.Fold Collect zero or more applications of a fold. many first second applies the first fold repeatedly on the input stream and accumulates it's results using the second fold.
>>> two = Fold.take 2 Fold.toList >>> twos = Fold.many two Fold.toList >>> Stream.fold twos $ Stream.fromList [1..10] [[1,2],[3,4],[5,6],[7,8],[9,10]]
Stops when second fold stops. See also: concatMap, foldManymany :: forall (m :: Type -> Type) a b c . Monad m => Parser a m b -> Fold m b c -> Parser a m cstreamly-core Streamly.Data.Parser Collect zero or more parses. Apply the supplied parser repeatedly on the input stream and push the parse results to a downstream fold. Stops: when the downstream fold stops or the parser fails. Fails: never, produces zero or more results.
>>> many = Parser.countBetween 0 maxBound
Compare with many.-
streamly-core Streamly.Data.Parser manyTill chunking test f tries the parser test on the input, if test fails it backtracks and tries chunking, after chunking succeeds test is tried again and so on. The parser stops when test succeeds. The output of test is discarded and the output of chunking is accumulated by the supplied fold. The parser fails if chunking fails. Stops when the fold f stops.
foldMany :: forall (m :: Type -> Type) a b . Monad m => Fold m a b -> Stream m a -> Stream m bstreamly-core Streamly.Data.Stream Apply a Fold repeatedly on a stream and emit the results in the output stream. Definition:
>>> foldMany f = Stream.parseMany (Parser.fromFold f)
Example, empty stream:>>> f = Fold.take 2 Fold.sum >>> fmany = Stream.fold Fold.toList . Stream.foldMany f >>> fmany $ Stream.fromList [] []
Example, last fold empty:>>> fmany $ Stream.fromList [1..4] [3,7]
Example, last fold non-empty:>>> fmany $ Stream.fromList [1..5] [3,7,5]
Note that using a closed fold e.g. Fold.take 0, would result in an infinite stream on a non-empty input stream.-
streamly-core Streamly.Data.Stream Apply a Parser repeatedly on a stream and emit the parsed values in the output stream. Example:
>>> s = Stream.fromList [1..10] >>> parser = Parser.takeBetween 0 2 Fold.sum >>> Stream.fold Fold.toList $ Stream.parseMany parser s [Right 3,Right 7,Right 11,Right 15,Right 19]
This is the streaming equivalent of the many parse combinator. Known Issues: When the parser fails there is no way to get the remaining stream. unfoldMany :: forall (m :: Type -> Type) a b . Monad m => Unfold m a b -> Stream m a -> Stream m bstreamly-core Streamly.Data.Stream unfoldMany unfold stream uses unfold to map the input stream elements to streams and then flattens the generated streams into a single output stream. Like concatMap but uses an Unfold for stream generation. Unlike concatMap this can fuse the Unfold code with the inner loop and therefore provide many times better performance.