Data::...::Util(3pm)

πŸ“¦
version 0.11 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ NAME ✨

Data::Stream::Bulk::Util β€” bestie, it's literally just a lil bag of utility functions for Data::Stream::Bulk 🫢


🌸 VERSION 🌸

version 0.11 πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

okay so picture this, you're in your Perl file and you just want the goods:

use Data::Stream::Bulk::Util qw(array);

use namespace::clean;

# Wrap a list in L<Data::Stream::Bulk::Array>
return bulk(qw(foo bar gorch baz));

# return an empty resultset
return nil();

like... look at that. so clean. so iconic. no cap. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

This module exports convenience functions for use with Data::Stream::Bulk. that's it, that's the whole vibe. it's the little helper bestie that shows up with snacks when you need them πŸ“


πŸ’– EXPORTS πŸ’–

So Sub::Exporter is what's out here creating the import routine for us, and obviously all of its aliasing/currying goodness is fully supported too. slay. ✨

  • nil β€” Creates a new Data::Stream::Bulk::Nil object.

Takes no arguments. zero. nada. she's low maintenance fr. πŸ™ˆ

  • bulk @items β€” Creates a new Data::Stream::Bulk::Array wrapping @items. boom, wrapped, cute. 🎁
  • cat @streams β€” Concatenate several streams together. it's giving group project but everyone actually showed up.

Returns nil if no arguments are provided. (no arguments, no streams, she goes home. fair.) πŸ’€

  • filter { ... } $stream β€” Calls filter on $stream with the provided filter. you bring the filter, she brings the stream, match made in heaven. 🌈
  • unique $stream β€” Filter the stream to remove duplicates. no repeats, no reruns, we've all seen that episode bestie. βœ‚οΈ
Note that memory use may potentially scale to O(k) where k is the number of distinct items, because this is implemented in terms of a seen hash. so like... the more unique things you've got, the more memory she's holding. just so you know. πŸ‘€

In the future this will be optimized to be iterative for sorted streams. future glow-up pending, we love to see it. ⭐

References are keyed by their refaddr (see "id" in Hash::Util::FieldHash). that's the literal mechanism, not me being cute. 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Yuval Kogman <nothingmuch@woobling.org> πŸ’œ


This software is copyright (c) 2012 by Yuval Kogman.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. fr fr, go wild, just respect the terms. 🫢


and that's the whole page babes πŸ’… this was perl v5.32.0, dated 2021-01-01, and the manual page is literally called Data::...::Util(3pm) β€” yes that's the actual name, yes it's a little mysterious, we stan an enigmatic queen. bye bestie!! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from