Skip to content
🏹 Bow is a library for Typed Functional Programming in Swift
Swift Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add templates for issues and pull requests (#93) Jan 16, 2019
Bow.xcodeproj
Documentation.app EnvIO utilities to run an operation (#505) Jan 24, 2020
Sources
Support Files
Tests Trampolining and stack-safety (#508) Feb 14, 2020
docs Remove pipe operator when using offset (#475) Nov 25, 2019
fastlane Update podspecs to latest version Dec 16, 2019
scripts Set version 0.7.0 as the current version for docs (#491) Dec 24, 2019
.gitignore Use fastlane to create github releases (#457) Oct 15, 2019
.travis.yml
Bow-Effects-Generators-Info.plist Generators for Effects, Rx, BrightFutures and Free (#338) Jun 11, 2019
Bow-Free-Generators-Info.plist Generators for Effects, Rx, BrightFutures and Free (#338) Jun 11, 2019
Bow-Generators-Info.plist
Bow-OpticsLaws-Info.plist Expose generators and laws as public artifacts (#389) Jul 9, 2019
Bow-RxGenerators-Info.plist Generators for Effects, Rx, BrightFutures and Free (#338) Jun 11, 2019
Bow.podspec Update podspecs to latest version Dec 16, 2019
BowEffects.podspec Update podspecs to latest version Dec 16, 2019
BowEffectsGenerators.podspec Update podspecs to latest version Dec 16, 2019
BowEffectsLaws.podspec Update podspecs to latest version Dec 16, 2019
BowFree.podspec Update podspecs to latest version Dec 16, 2019
BowFreeGenerators.podspec
BowGenerators.podspec Update podspecs to latest version Dec 16, 2019
BowGeneric.podspec Update podspecs to latest version Dec 16, 2019
BowLaws.podspec Update podspecs to latest version Dec 16, 2019
BowOptics.podspec Update podspecs to latest version Dec 16, 2019
BowOpticsLaws.podspec
BowRecursionSchemes.podspec
BowRx.podspec
BowRxGenerators.podspec Update podspecs to latest version Dec 16, 2019
CHANGELOG Use fastlane to create github releases (#457) Oct 15, 2019
CODE_OF_CONDUCT.md Add code of conduct (#180) Mar 6, 2019
CONTRIBUTING.md
Cartfile Remove BrightFutures integration (#402) Sep 12, 2019
Cartfile.private
Gemfile
Gemfile.lock Update gemfile lock Dec 16, 2019
LICENSE Add license (#56) Oct 23, 2018
Package.resolved
Package.swift Fix Package.swift (#444) Oct 1, 2019
README.md
favicon.png Bow rebranding (#326) May 6, 2019

README.md

Bow is a library for Typed Functional Programming in Swift.

Documentation

All documentation and API reference is published in our website. Some links to key aspects of the library:

Modules

Bow is split into multiple modules that can be consumed independently. These modules are:

  • Bow: core library. Contains Higher Kinded Types emulation, function manipulation utilities, Typeclasses, Data Types, Monad Transformers, and instances for primitive types.
  • BowOptics: module to work with different optics.
  • BowRecursionSchemes: module to work with recursion schemes.
  • BowFree: module to work with Free Monads.
  • BowGeneric: module to work with generic data types.
  • BowEffects: module to work with effects.
  • BowRx: module to provide an integration with RxSwift.

There are also some modules for testing:

  • BowLaws: laws for type classes in the core module.
  • BowOpticsLaws: laws for optics.
  • BowEffectsLaws: laws for effects.
  • BowGenerators: generators for Property-based Testing for data types in the core module.
  • BowFreeGenerators: generators for Property-based Testing for data types in BowFree.
  • BowEffectsGenerators: generators for Property-based Testing for data types in BowEffects.
  • BowRxGenerators: generators for Property-based Testing for data types in BowRx.

Bow is available using Swift Package Manager, CocoaPods, and Carthage.

Swift Package Manager

Starting on Xcode 11, you can use the integration in the IDE with Swift Package manager to bring the dependencies into your project. You only need the repository URL: https://github.com/bow-swift/bow.git. For earlier versions of Xcode, create a Package.swift file similar to the next one and use the dependencies at your convenience.

// 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"])
    ]
)

To build it, just run:

$ swift build

CocoaPods

You can consume each Bow module as a separate pod. You can add these lines to your Podfile at your convenience:

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

Testing laws:

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

Generators for property-based testing with SwiftCheck:

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

Carthage

Carthage will download the whole Bow project, but it will compile individual frameworks for each module that you can use separately. Add this line to your Cartfile:

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

Contributing

If you want to contribute to this library, you can check the Issues to see some of the pending tasks.

How to run the project

Open Bow.xcodeproj in Xcode 11 (or newer) and you are ready to go. Bow uses the Swift Package Manager to handle its dependencies.

How to run the documentation project

  • Go to the directory contents/Documentation.
  • Run pod install to get all dependencies.
  • Open Documentation.xcworkspace and run the project.

For further information, refer to our Contribution guidelines.

How to create a new release

You can create a new release by running bundle exec fastlane release version_number:. For example, bundle exec fastlane release version_number: 0.6.0.

The following steps would be run:

  • Update the version in *.podspec files.
  • Create a tag with message added in the CHANGELOG file.
  • Deploy podspec files and make them publicly available.

License

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

   http://www.apache.org/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.
You can’t perform that action at this time.