Class FromList


public class FromList extends PrimitiveFunction
Creates a map from a list of pairs.
  • Constructor Details

    • FromList

      public FromList()
  • Method Details

    • name

      public Name name()
      Get the name of this primitive function.
      Specified by:
      name in class PrimitiveFunction
      Returns:
      the name
    • type

      public TypeScheme type()
      Get the type scheme of this primitive function.
      Specified by:
      type in class PrimitiveFunction
      Returns:
      the type scheme
    • implementation

      protected Function<List<Term>,Flow<Graph,Term>> implementation()
      Get the implementation of this primitive function.
      Specified by:
      implementation in class PrimitiveFunction
      Returns:
      the implementation function
    • apply

      public static <K, V> Map<K,V> apply(List<Tuple.Tuple2<K,V>> pairs)
      Apply the function to its single argument.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      pairs - the list of key-value pairs
      Returns:
      a map constructed from the pairs