Merge pull request #5 from to4iki/git-hooks Setup git-hooks via Komondor
Merge pull request #5 from to4iki/git-hooks
Setup git-hooks via Komondor
Komondor
Reader monad in Swift, inspired by implemention with Scala.
Reader is a wrapper for function that take some Input and produce Element.
Reader
Input
Element
// init(_:) let reader = Reader<Int, Int> { $0 + 2 } // execute(_:) reader.execute(1) // 3 reader.execute(2) // 4 // map(_:) reader .map { $0 * 2 } .execute(3) // 10 // flatMap(_:) reader .flatMap { i1 in Reader<Int, Int> { i2 in i1 * i2 } } .execute(4) // 24
Simple and static Dependency Injection is possible with Reader
example: Playground
Add following line into your Cartfile and run carthage update.
carthage update
github "to4iki/Reader"
Add following line into your Package.swift and run swift build.
swift build
dependencies: [ .Package(url: "https://github.com/to4iki/Reader.git", majorVersion: 0) ]
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Reader
Reader monad in Swift, inspired by implemention with Scala.
Overview
Reader
is a wrapper for function that take someInput
and produceElement
.Simple and static Dependency Injection is possible with
Reader
example: Playground
Installation
Carthage
Add following line into your Cartfile and run
carthage update
.SwiftPackage Manager
Add following line into your Package.swift and run
swift build
.