BowGeneric 0.8.0

BowGeneric 0.8.0

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



  • 作者
  • Bow 的作者

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

文档

所有文档和 API 参考都发布在我们的网站 https://bow-swift.io/ 上。一些到库关键方面的链接

模块

Bow 被分割成多个可以独立使用的模块。这些模块是

  • Bow:核心库。包含高阶类型仿真、函数操作实用工具、类型类、数据类型、单体转换器和原生类型的实例。
  • BowOptics:用于不同光学的模块。
  • BowRecursionSchemes:用于递归方案的模块。
  • BowFree:用于自由单子的模块。
  • BowGeneric:用于泛型数据类型的模块。
  • BowEffects:用于效果的模块。
  • BowRx:提供与 RxSwift 整合的模块。

还有一些用于测试的模块

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

Bow 可以通过 Swift 包管理器、CocoaPods 和 Carthage 获取。

Swift 包管理器

从 Xcode 11 开始,您可以使用 IDE 中的集成功能,通过 Swift 包管理器将依赖项引入到您的项目中。您只需要仓库 URL:[https://github.com/bow-swift/bow.git](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 模块作为独立的 pod 来消费。您可以在方便时将这些行添加到您的 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.