BowEffects 0.8.0

BowEffects 0.8.0

TomásRuizLópezMiguel Ángel Díazjuancazalla维护。



  • Bow 作者团队

Bow 是一个 Swift 中的跨平台类型化函数式编程库。

文档

所有文档和 API 参考都发布在我们的网站上 这里。以下是一些链接到库的关键方面

模块

Bow 被分割成多个模块,可以独立消费。这些模块包括

  • Bow:核心库。包含高阶类型模拟、函数操作实用工具、类型类、数据类型、Monads 变换器,以及原始类型实例。
  • BowOptics:用于处理不同光学模块。
  • BowRecursionSchemes:用于处理递归设计的模块。
  • BowFree:用于处理 Free Monads 的模块。
  • BowGeneric:用于处理泛型数据类型的模块。
  • BowEffects:用于处理效果的模块。
  • BowRx:提供与 RxSwift 集成的模块。

还有一些用于测试的模块

  • BowLaws:核心模块中类型类的定律。
  • BowOpticsLaws:光学的定律。
  • BowEffectsLaws:效果的定律。
  • BowGenerators:用于在核心模块的数据类型中执行基于属性的测试的生成器。
  • BowFreeGenerators:用于在 BowFree 中的数据类型中执行基于属性的测试的生成器。
  • BowEffectsGenerators:用于在 BowEffects 中的数据类型中执行基于属性的测试的生成器。
  • BowRxGenerators:用于在 BowRx 中的数据类型中执行基于属性的测试的生成器。

Bow 可以使用 Swift Package Manager、CocoaPods 和 Carthage 获取。

Swift 包管理器

从 Xcode 11 开始,您可以使用 IDE 中的集成功能,与 Swift 包管理器一起使用,将依赖项引入到您的项目中。您只需要仓库 URL: https://github.com/bow-swift/bow.git。对于更早版本的 Xcode,创建一个类似于下面的 Package.swift 文件,并按需使用依赖项。

// swift-tools-version:5.0

import PackageDescription

let package = Package(
    name: "BowTestProject",
    dependencies: [
        .package(url: "https://github.com/bow-swift/bow.git", from: "{version}")
    ],
    targets: [
        .target(name: "BowTestProject",
                dependencies: [
                    "Bow",
                    "BowOptics",
                    "BowRecursionSchemes",
                    "BowFree",
                    "BowGeneric",
                    "BowEffects",
                    "BowRx"]),
        .testTarget(name: "BowTestProjectTests",
                    dependencies: [
                        // Type class laws
                        "BowLaws",
                        "BowOpticsLaws",
                        "BowEffectsLaws",

                        // Generators for PBT with SwiftCheck
                        "BowGenerators",
                        "BowFreeGenerators",
                        "BowEffectsGenerators",
                        "BowRxGenerators"])
    ]
)

要构建它,只需运行

$ swift build

CocoaPods

您可以单独消费每个 Bow 模块。您可以在 Podfile 中添加这些行,按需使用。

pod "Bow",                 "~> {version}"
pod "BowOptics",           "~> {version}"
pod "BowRecursionSchemes", "~> {version}"
pod "BowFree",             "~> {version}"
pod "BowGeneric",          "~> {version}"
pod "BowEffects",          "~> {version}"
pod "BowRx",               "~> {version}"

测试法则

pod "BowLaws",        "~> {version}"
pod "BowOpticsLaws",  "~> {version}"
pod "BowEffectsLaws", "~> {version}"

使用 SwiftCheck 进行属性测试的生成器

pod "BowGenerators",              "~> {version}"
pod "BowFreeGenerators",          "~> {version}"
pod "BowEffectsGenerators",       "~> {version}"
pod "BowRxGenerators",            "~> {version}"

Carthage

Carthage 将下载完整的 Bow 项,但是将为每个模块编译独立框架,您可以将它们单独使用。请将此行添加到 Cartfile 中

github "bow-swift/Bow" ~> {version}

积极贡献

如果您想为此库做出贡献,可以查看 问题 来了解一些悬而未决的任务。

如何运行项目

在 Xcode 11(或更高版本)中打开 Bow.xcodeproj,您就绪了。Bow 使用 Swift 包管理器来处理其依赖项。

如何运行文档项目

  • 转到目录 contents/Documentation
  • 运行 pod install 以获取所有依赖项。
  • 打开 Documentation.xcworkspace 并运行项目。

有关更多信息,请参阅我们的 贡献指南

如何创建新版本

您可以通过运行 bundle exec fastlane release version_number: 创建一个新版本。例如,bundle exec fastlane release version_number: 0.7.0

以下步骤将会执行:

  • 更新 *.podspec 文件中的 version
  • CHANGELOG 文件中添加标记信息。
  • 部署 podspec 文件,并使其公开可用。

许可证

Copyright (C) 2018-2020 The Bow Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://apache.ac.cn/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.