Monad-std

Latest version: v0.9.0

Safety actively analyzes 624712 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.9.0

**ADD**:

- `monad_std.iter.IterMeta`:
- `map_while`: Yields elements based on both a predicate and maps.
- `map_windows`: A map but with fixed-sized windows.
- `batching`: A meta-iterator over iterator and let you generate values manually.
- `max`, `max_by`, `max_by_key`, `min`, `min_by`, `min_by_key`: Get the maximum / minimum value.
- `collect_to_xxx`: Collect the iterator into a mutable and extendable item.<br />
Note that in Python it's not possible to actually *change* a `str`, so `collect_to_string` is not provided.
- `collect_set`: Collect the iterator into a hashset.
- `partition`, `partition_map`, `partition_list`, `partition_map_list`, `partition_by`:
Split the iterator with a predicate.
- Aliases:
- `filter_ok`, `filter_err`, `filter_map_ok`, `filter_map_err`
- `map_ok`, `map_err`
- `partition_result`
- `monad_std.typedef`: Internal type definition.
- `monad_std.utils`: Utility used inside and outside (recommend, but not forced) the library.
- `monad_std.either.Either`: A structure containing two type of values, but not that specific like `monad_std.Result`.

**Impl Change**

- Use `import typing` instead of `from typing import ...` to make the scope and namespace cleaner.
- All iterator implementation will be moved to their single files,
and can stil be imported from `monad_std.iter.impl`.

0.8.0

**ADD**:

- `monad_std.prelude`: module that contains all frequently used utilities.
- `monad_std.iter`:
- `siter`: See `IterMeta.iter`.
- `once`: See `IterMeta.once`.
- `once_with`: See `IterMeta.once_with`.
- `repeat`: See `IterMeta.repeat`.

0.7.0

**ADD**:

- `monad_std.Option`:
- `map_mut`: Map a value by changing itself.
- `monad_std.Result`:
- `map_mut`, `map_err_mut`: Map a value by changing itself.

**Breaking Change**

- Renamed all iterator tools' implement definition. Now they're not prefix-ed by an `_Iter`.
You can now import them via `monad_std.iter.impl`.

0.6.0

**ADD**:

- `monad_std.iter.IterMeta`:
- `chunk`: Data chunks which will return all the data, including those ignored ones by `array_chunk`.

0.5.0

**ADD**:

- `monad_std.Option`:
- `to_pattern`: An alias for `unwrap_unchecked`.
- `monad_std.Result`:
- `to_pattern`: Transfer into a tuple for pattern matching.
- `ERR`, `OK`: Constant flag value. See `monad_std.Result.to_pattern`.

0.4.0

**ADD**

- `monad_std.Option`:
- `to_nullable`/`unwrap_unchecked`: Convert `Option[T]` to `Optional[T]`.
- `monad_std.Result`:
- `unwrap_unchecked`: Convert `Result[T, E]` to `Union[T, E]`.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.