Class Unlines


public class Unlines extends PrimitiveFunction
Joins a list of strings with newlines and appends a final newline.
  • Constructor Details

    • Unlines

      public Unlines()
  • Method Details

    • name

      public Name name()
      Returns the name of this primitive function.
      Specified by:
      name in class PrimitiveFunction
      Returns:
      the name "hydra.lib.strings.unlines"
    • type

      public TypeScheme type()
      Returns the type scheme of this function.
      Specified by:
      type in class PrimitiveFunction
      Returns:
      the type scheme for a function that joins strings with newlines
    • implementation

      protected Function<List<Term>,Flow<Graph,Term>> implementation()
      Provides the implementation of this primitive function.
      Specified by:
      implementation in class PrimitiveFunction
      Returns:
      a function that transforms terms to a flow of graph and term
    • apply

      public static String apply(List<String> lines)
      Joins a list of strings with newlines and appends a final newline.
      Parameters:
      lines - the list of strings to join
      Returns:
      the joined string with newlines