bow Playground

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

文档

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

模块

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

还有一些用于测试的模块:

Bow 可以通过 Swift Package Manager、CocoaPods 和 Carthage 获取。

Swift Package Manager

从 Xcode 11 开始,您可以使用 IDE 中与 Swift Package Manager 的集成将依赖项引入到您的项目中。 您只需要仓库 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 模块作为单独的 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}

贡献

如果您想为这个库做出贡献,您可以查看 Issues 页面,了解一些待处理的任务。

如何运行项目

在 Xcode 11(或更高版本)中打开 Bow.xcodeproj,您就可以开始了。 Bow 使用 Swift Package Manager 来处理其依赖项。

如何运行文档项目

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

如何创建新版本

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

将运行以下步骤

许可证

Copyright (C) 2018-2021 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.