Package hydra.lib.maps
Class FromList
- java.lang.Object
-
- hydra.tools.PrimitiveFunction
-
- hydra.lib.maps.FromList
-
public class FromList extends PrimitiveFunction
Creates a map from a list of pairs.
-
-
Constructor Summary
Constructors Constructor Description FromList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
PersistentMap<K,V>apply(ConsList<Pair<K,V>> pairs)Apply the function to its single argument.static <K,V>
PersistentMap<K,V>apply(java.util.List<Pair<K,V>> pairs)protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<Context,java.util.function.Function<Graph,Either<InContext<Error_>,Term>>>>implementation()Get the implementation of this primitive function.Namename()Get the name of this primitive function.TypeSchemetype()Get the type scheme of this primitive function.-
Methods inherited from class hydra.tools.PrimitiveFunction
term, toNative
-
-
-
-
Method Detail
-
name
public Name name()
Get the name of this primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name
-
type
public TypeScheme type()
Get the type scheme of this primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme
-
implementation
protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<Context,java.util.function.Function<Graph,Either<InContext<Error_>,Term>>>> implementation()
Get the implementation of this primitive function.- Specified by:
implementationin classPrimitiveFunction- Returns:
- the implementation function
-
apply
public static <K,V> PersistentMap<K,V> apply(ConsList<Pair<K,V>> pairs)
Apply the function to its single argument.- Type Parameters:
K- the key typeV- the value type- Parameters:
pairs- the list of key-value pairs- Returns:
- a map constructed from the pairs
-
apply
public static <K,V> PersistentMap<K,V> apply(java.util.List<Pair<K,V>> pairs)
-
-