~/bend-docscommunity

kernel_block.bend checks

raw source on the hub · import stelliferous@0.0.2.0/kernel_block.bend as Kernel_block

1 import
import Base

Types

type Twin source · line 4 · raw

@-Element:Data -> Data

A statically shaped product. Pairing readers preserves one buffer owner.

Templates

template zip_map source · line 9 · raw

@-Element:Data -> @-Context:Data -> @-combine:(@_:Element -> @_:Element -> @_:Context -> Element) -> @left:Twin<Element> -> @right:Twin<Element> -> @context:Context -> Twin<Element>

Static product composition also lifts an operation to any pair of elements. Nesting this template gives wider products without another arithmetic kernel.

template finish_pair source · line 16 · raw

@-State:Type -> @-Element:Data -> @first:Element -> @result:Pair(State, Element) -> Pair(State, Twin<Element>)

template read_second source · line 20 · raw

@-State:Type -> @-Context:Data -> @-Element:Data -> @-Index:Data -> @-read:(@_:State -> @_:Context -> @_:Index -> Pair(State, Element)) -> @result:Pair(State, Element) -> @context:Context -> @index:Index -> Pair(State, Twin<Element>)

template read_at source · line 28 · raw

@-State:Type -> @-Context:Data -> @-Element:Data -> @-Index:Data -> @-read:(@_:State -> @_:Context -> @_:Index -> Pair(State, Element)) -> @state:State -> @+context:Context -> @first:Index -> @second:Index -> Pair(State, Twin<Element>)

template read_pair source · line 35 · raw

@-State:Type -> @-Context:Data -> @-Element:Data -> @-read:(@_:State -> @_:Context -> @_:Nat -> Pair(State, Element)) -> @-stride:Nat -> @state:State -> @context:Context -> @index:Nat -> Pair(State, Twin<Element>)