Explicit Function signatures as object with documentation

  1. Instead of defining the signature as string:
{
name: "TypeTest",
  coll: Function,
  ts: Time("2023-06-15T16:26:49.410Z"),
  body: "(x, y) => x + y ",
  signature: "(x: Number, y: Number) => Number"
}

defining it as object

{
  signature: {
    description: "Calculates the sum of two numbers.",
    params: [
      {
        name: x,
        type: Number,
        doc: "The first number to add."
      },
      {
        name: x,
        type: Number,
        doc: "The second number to add."
      }
    ],
    returns: {
      type: Number,
      doc: "the sum of x and y"
    }
  }
}
  1. Fauna should add the signature automatically if not specified (Being explicit)

With that, we can easily access the signature with FQL syntax, enabling Use Cases where we need to programmatically interact with Functions, e.g., Rule Engine or No-Code Editor.