shared/names.bend checks
raw source on the hub · import bend-lint-api@0.1.1.0/shared/names.bend as Names
2 imports
import Base import ./lists.bend as Lists
Types
type Named source · line 5 · raw
@-A:Data -> Data
A value, with the name it is written as.
Named@-A:Data -> @name:String -> @value:A -> Named<A>
Definitions
def lookup.go source · line 8 · raw
@-A:Data -> @+key:String -> @table:List<&2, Named<A>> -> @found:Maybe<&2, A> -> Maybe<&2, A>
def lookup source · line 31 · raw
@-A:Data -> @key:String -> @table:List<&2, Named<A>> -> Maybe<&2, A>
The value key names in table: the first, read no further.
def find source · line 36 · raw
@-A:Data -> @table:Map<&2, Maybe<&2, A>> -> @key:String -> Maybe<&2, A>
The value key names in table, a map by name (as Lint.definitions makes): one pass over the name, however many
names there are.
def Group.add.of source · line 42 · raw
@-A:Data -> @got:Pair(Map<&2, List<&2, A>>, List<&2, A>) -> @key:String -> @x:A -> Map<&2, List<&2, A>>
Groups ====== Values by name, in a map: each name's values, last first.
def Group.add source · line 53 · raw
@-A:Data -> @groups:Map<&2, List<&2, A>> -> @+key:String -> @x:A -> Map<&2, List<&2, A>>
groups with x added under key. A key's list is last first; Group.get gives it in order.
def Group.get source · line 57 · raw
@-A:Data -> @groups:Map<&2, List<&2, A>> -> @key:String -> List<&2, A>
What is added under key, in the order added.
Templates
template table source · line 23 · raw
@-A:Data -> @-show:(@_:A -> String) -> @xs:List<&2, A> -> List<&2, Named<A>>
Each of xs with the name show gives it: a table for lookup, so that each name is written once, in show.
template Group.of source · line 64 · raw
@-A:Data -> @-key:(@_:A -> String) -> @xs:List<&2, A> -> @groups:Map<&2, List<&2, A>> -> Map<&2, List<&2, A>>