mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
We really don’t need this old thing.
This commit is contained in:
parent
83e3c8e232
commit
13f1d70071
@ -8,12 +8,6 @@ public struct Prism<From, To> {
|
||||
public let backward: To -> From
|
||||
}
|
||||
|
||||
extension Dictionary {
|
||||
static func prism(key: Key) -> Prism<[Key:Value], Value> {
|
||||
return Prism(forward: { $0[key] }, backward: { [key: $0] })
|
||||
}
|
||||
}
|
||||
|
||||
public func >>> <From, Part, To> (left: Prism<From, Part>, right: Prism<Part, To>) -> Prism<From, To> {
|
||||
return Prism(forward: { left.forward($0).flatMap(right.forward) }, backward: right.backward >>> left.backward)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user