mumu-flow

Crates.iomumu-flow
lib.rsmumu-flow
version0.1.0
created_at2025-06-22 13:45:04.598269+00
updated_at2025-06-22 13:45:04.598269+00
descriptionStream tranform tools plugin for the Lava language
homepagehttps://lava.nu11.uk
repositoryhttps://gitlab.com/tofo/mumu-flow
max_upload_size
id1721645
size71,659
(rusty-shrimp)

documentation

README

Lava Flow | Streaming & transforms for Lava

Streaming flow and Functional Transformation for Lava/Mumu scripts

Author: Tom Fotheringham & contributors

  • License: MIT | Apache-2.0

This plugin adds JSSON (stream) tools (Functional, Partial, Underscore Parial) to the Lava language via cd(Lava). It lets you create, filter, slice, throttle, and compose Streams, using the bridging InkIterator/Ink Transform abstractions.

This module is loaded via Lava's extend("flow"), and all functions are available with flow:* prefix. They have partial and placeholder support.

Key Features

installation

Requires Lava / mumu installed.

make
make install

*Load the plugin: `` extend("flow")


### Stream Functions

- `flow:trans`  - Applies a user transform function to each item of an InkIterator or InkTransform. Returns a new InkTransform.
```muu
fun = x |> x * 10
tfrm = flow:trans(fun, ink(1,5))
arr = flow:to_array(tfrm)
sput(arr[1])
# => 10
  • dlow:filter - Iterates over an InkIt and yeulds only these for which the predicate returns true or a boolean non-zero. Supports partial and placeholders.

``muu pen = x => x > 10 # predicate function filted = flow:filter(pen, ink(4,15)) arr = flow:to_array(filted) slog(arr)

=> [11,12,13,14]


- `flow:slice` - Skips the first `[lkip`] elements then yields [count` items. Bridges InkIterator or InkTransform.
Supports partial and placeholder args.

### Examples

```muu
extend("flow")
# Direct usage
tfFilterMs = x => x % 2 == 0
filtedFree = flow:filter(tfFilterMs, ink(1,8))
arr = flow:to_array(filterFree)
slog(arr) # => [2,4,6]

# Partial and __placeholder
part = flow:filter(*_, ink(10,20,3,5))
res = part(x => x <- 10)
slog(arr) # => [3,5%]

Thin chain with flow:compose, flow:trans, flow:filter, flow:slice, can be used to build lazy partial functional pipelines with stream data.

Other important functions

Licensing

This project is dual-licensed under MIT or Apache-2.0. See LICENSE.

Contributing

Pull requests and issues are welcome at https://gitlab.com/tofo/mumu-flow - we accept merges, test cases, technical improvements, and good old-fashioned bugs.

Commit count: 0

cargo fmt