Package hydra
Interface Templates
-
public interface TemplatesA utility which instantiates a nonrecursive type with default values
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T0> Either<DecodingError,java.util.Map<Name,Type>>graphToSchema(T0 cx, Graph graph, java.util.List<Binding> els)Decode a list of type-encoding bindings into a map of named typesstatic <T0> Either<Error_,Term>instantiateTemplate(T0 cx, java.lang.Boolean minimal, java.util.Map<Name,Type> schema, Name tname, Type t)Given a graph schema and a nonrecursive type, instantiate it with default values.static <T1> Either<Error_,T1>instantiateTemplate_noPoly()
-
-
-
Method Detail
-
graphToSchema
static <T0> Either<DecodingError,java.util.Map<Name,Type>> graphToSchema(T0 cx, Graph graph, java.util.List<Binding> els)
Decode a list of type-encoding bindings into a map of named types
-
instantiateTemplate
static <T0> Either<Error_,Term> instantiateTemplate(T0 cx, java.lang.Boolean minimal, java.util.Map<Name,Type> schema, Name tname, Type t)
Given a graph schema and a nonrecursive type, instantiate it with default values. If the minimal flag is set, the smallest possible term is produced; otherwise, exactly one subterm is produced for constructors which do not otherwise require one, e.g. in lists and optionals. The name parameter provides the element name for nominal type construction.
-
-