Skip to content

Instantly share code, notes, and snippets.

object Prisms {
// Sum type constructors
def left[B, C](x: B): (B=>C)=>C = {
(k) => {
k(x)
}
}
FGeometry ComputeMenuPlacement(const FGeometry& AllottedGeometry, const FVector2D& PopupDesiredSize, EMenuPlacement PlacementMode)
{
// Compute the popup size, offset, and anchor rect in local space
const FPopupPlacement Placement(AllottedGeometry, PopupDesiredSize, PlacementMode);
// ask the application to compute the proper desktop offset for the anchor. This requires the offsets to be in desktop space.
const FVector2D NewPositionDesktopSpace = FSlateApplication::Get().CalculatePopupWindowPosition(
TransformRect(AllottedGeometry.GetAccumulatedLayoutTransform(), FSlateRect(Placement.AnchorLocalSpace.GetTopLeft() + Placement.LocalPopupOffset, Placement.AnchorLocalSpace\
.GetBottomRight() + Placement.LocalPopupOffset)),
TransformVector(AllottedGeometry.GetAccumulatedLayoutTransform(), Placement.LocalPopupSize),
/**
* 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.
//
/**
* 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;
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