Documentation ¶
Overview ¶
Package values defines data structures for representing (runtime) values in Reflow. Any valid reflow type has representable values (see grail.com/reflow/types) and the structures in this package mirror those in the type system.
Values are represented by values.T, defined as
type T = interface{}
which is done to clarify code that uses reflow values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Digester = digest.Digester(crypto.SHA256)
Digester is the digester used to compute value digests.
var Unit = struct{}{}
Unit is the unit value.
Functions ¶
Types ¶
type Env ¶
type Env struct { // Symtab is the symbol table for this level. Symtab Symtab // contains filtered or unexported fields }
Env binds identifiers to evaluation.
func (*Env) Debug ¶
func (e *Env) Debug()
Debug sets the debug flag on this environment. This causes IsDebug to return true.
func (*Env) Digest ¶
Digest returns the digest for the value with idenfier id. The supplied type is used to compute the digest. If the value is a digest.Digest, it is returned directly; if implements the interface
interface{ Digest() digest.Digest }
it returns the result of calling the Digest Method.
func (*Env) Level ¶
Level returns the level of identifier id. Level can thus be used as a de-Bruijn index (in conjunction with the identifier).
type Func ¶
type Func interface { // Apply invokes this function with an argument list. // The supplied location may be used by system functions // for debugging and decorating flows. Apply(loc Location, args []T) (T, error) // Digest returns the digest of this function. Digest() digest.Digest }
Func is the type of function value.
type Map ¶
Map is the type of map values. It uses a Go map as a hash table based on the key's digest, which in turn stores a list of entries that share the same hash bucket.