Class Singleton


public class Singleton extends PrimitiveFunction
Creates a singleton list.
  • Constructor Details

    • Singleton

      public Singleton()
  • 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> Function<V,Map<K,V>> apply(K key)
      Creates a map with one element.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key - the key
      Returns:
      a function that takes a value and returns the singleton map
    • apply

      public static <K, V> Map<K,V> apply(K key, V value)
      Creates a map with one element.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key - the key
      value - the value
      Returns:
      the singleton map