Spine

libretto.lambda.Spine
See theSpine companion object
sealed trait Spine[**[_, _], G[_], F[_]]

Nested tuples with a hole.

For example, a structure

(G[A], (G[B], (◯, G[C])))

where ◯ is the hole, can be represented as

Spine[**, G, F] where F[X] = A ** (B ** (X ** C))

Like Focus, a Spine defines a path into a tupled structure, but Spine also contains data along the path.

Type parameters

**

the tuple type constructor

F

context of the hole

G

tuple elements ("garnish" hanging from the spine)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fst[|*|, G, F, B]
class Id[|*|, G]
class Snd[|*|, G, F, A]

Members list

Value members

Abstract methods

def knitFoldMap[H[_]](k: Knit[**, F], f: [x] => (x$1: G[x]) => H[x])(using BiInjective[**], Zippable[**, H]): H[Res]

Concrete methods

def focus: Focus[**, F]
def inFst[B](b: G[B]): Spine[**, G, [x] =>> F[x] ** B]
def inSnd[A](a: G[A]): Spine[**, G, [x] =>> A ** F[x]]
def knit(k: Knit[**, F])(using BiInjective[**]): Tupled[**, G, Res]
def knitFold(k: Knit[**, F])(using BiInjective[**], Zippable[**, G]): G[Res]
def plugFold[A](a: G[A])(using Zippable[**, G]): G[F[A]]