Expr

libretto.lambda.LambdasImpl.Expr
See theExpr companion object
sealed trait Expr[B]

AST of an expression, created by user code, before translation to point-free representation, containing intermediate Vars. Non-linear: includes projections and multiple occurrences of the same variable.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Id[A]
class Map[B, C]
class Prj1[B1, B2]
class Prj2[B1, B2]
class Zip[B1, B2]

Members list

Concise view

Value members

Abstract methods

def resultVar: Var[B]

Concrete methods

def cutAt[G[_]](p: [X] => (x$1: Expr[X]) => Option[G[X]]): Exists[[x] =>> (Tupled[[t] =>> Either[Var[t], G[t]], x], Expr[B])]
def map[C](f: B -⚬ C)(resultVar: Var[C]): Expr[C]
def splitAt(p: [X] => (x$1: Var[X]) => Boolean): Exists[[x] =>> (Tupled[[t] =>> Either[Var[t], Expr[t]], x], Expr[B])]

Goes from the end backwards (i.e. from the result variable towards inital variables) and splits this expression at the boundary where the given predicate first returns true. Initial variables of the resulting trimmed Expr[B] (second part of the returned tuple) are exactly the terminal variables of the returned prefix expressions (first part of the returned tuple). If in some branch the predicate never returns true, the expression's initial variable in that branch is returned as Left.

Goes from the end backwards (i.e. from the result variable towards inital variables) and splits this expression at the boundary where the given predicate first returns true. Initial variables of the resulting trimmed Expr[B] (second part of the returned tuple) are exactly the terminal variables of the returned prefix expressions (first part of the returned tuple). If in some branch the predicate never returns true, the expression's initial variable in that branch is returned as Left.

Attributes

def zip[D](that: Expr[D])(resultVar: Var[B |*| D]): Expr[B |*| D]