BowGenerators 0.8.0

BowGenerators 0.8.0

TomásRuizLópez维护。



 
依赖关系
Bow~> 0.8.0
SwiftCheck~> 0.12.0
 

  • 作者:
  • The Bow authors

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

文档

所有文档和API参考都发布在我们的网站上。一些库的关键部分的链接

模块

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

  • Bow: 核心库。包含高阶类型模拟、函数操作工具、Typeclasses、数据类型、 Монад Трансформаторы以及原始类型实例。
  • BowOptics: 用于不同光学的工作模块。
  • BowRecursionSchemes: 用于递归模式的工作模块。
  • BowFree: 用于Free Monads的工作模块。
  • 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.