This file contains hidden or 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
object Prisms { | |
// Sum type constructors | |
def left[B, C](x: B): (B=>C)=>C = { | |
(k) => { | |
k(x) | |
} | |
} | |
This file contains hidden or 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
/** | |
* Algebraic Effects and Handlers as in <a href='http://www.eff-lang.org/'>Eff</a> | |
*/ | |
'use strict' | |
// | |
// Note: | |
// new Continuation() - returns the current function's continuation. | |
// |
This file contains hidden or 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
/** | |
* One-shot continuation built on top of FPendingLatentAction | |
*/ | |
template <class T> class FContinueAction : public FPendingLatentAction | |
{ | |
bool Called; | |
const FName ExecutionFunction; | |
const int32 OutputLink; | |
const FWeakObjectPtr CallbackTarget; |
This file contains hidden or 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
package main.scala.test | |
import scala.collection.mutable | |
// Push Mode | |
// as in Rx | |
trait Observer[-A] { | |
def onNext(x: Option[A]): Unit | |
def contramap[B](f: B=>A): Observer[B] = { | |
val self = this |
NewerOlder