This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://blog.sigfpe.com/2008/12/mother-of-all-monads.html | |
// MARK: function composition | |
infix operator >>> { associativity left } | |
func >>> <A, B, C>(f: A -> B, g: B -> C) -> A -> C { | |
return { x in g(f(x)) } | |
} | |
// MARK: Continuation monad | |
struct Cont<R, A> { |
NewerOlder