1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00
semantic/prototype/Doubt/Prelude.swift
Rob Rix 93fd2acc81 Add 'prototype/' from commit 'a7fef6ced9d2b71dfdf5e6d8fb765ab0c0bc6be5'
git-subtree-dir: prototype
git-subtree-mainline: 0244ce39f68a04b515f32b2b8ea9a3e0228923c7
git-subtree-split: a7fef6ced9
2015-09-15 12:32:12 -04:00

20 lines
271 B
Swift

func fix<T, U>(f: (T -> U) -> T -> U) -> T -> U {
return { f(fix(f))($0) }
}
func const<A, B>(a: A)(_ b: B) -> A {
return a
}
infix operator >>> {
associativity right
precedence 170
}
func >>> <T, U, V> (f: T -> U, g: U -> V) -> T -> V {
return { g(f($0)) }
}