定制 tmanley1985/php-transducers 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tmanley1985/php-transducers

最新稳定版本:v1.0.1

Composer 安装命令:

composer require tmanley1985/php-transducers

包简介

An implementation of transducers for php

README 文档

README

An implementation of transducers in php

About

Transducers allow you to compose map and filter operations without the need for intermediate data structures by composing reducing functions (reducers). They're like a factory for reducing functions. Whenever you run a map or filter operation, you're creating a new intermediate data structure which is usually negligible, but as the size of your input scales, so do these operations.

True transducers should be able to operate on multiple data structures: trees, streams, arrays, etc. This library only operates on arrays.

I've created two videos as part of a larger series on the reduce method on youtube. All examples are in es6:

  1. Transducers: Mapping
  2. Transducers: Filtering

TOC

Installation

First:

composer require tmanley1985/php-transducers

Usage

use TManley1985\PhpTransducers\TransducibleCollection;

TransducibleCollection::fromValues([10,11,12,13])
    ->transMap(fn ($num) => $num + 1)
    ->transFilter(fn ($num) => $num % 2 === 0)
    ->transduce(); // [12,14]

Versioning

We use SemVer for versioning.

License

This project is licensed under the MIT License

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固