code: func interpolationFuncElement() ast.Function {
  	return ast.Function{
  		ArgTypes:   []ast.Type{ast.TypeList, ast.TypeString},
  		ReturnType: ast.TypeString,
  		Callback: func(args []interface{}) (interface{}, error) {
  			list := args[0].([]ast.Variable)
  			if len(list) == 0 {
  				return nil, fmt.Errorf("element() may not be used with an empty list")
  			}
  
  			index, err := strconv.Atoi(args[1].(string))
  			if err != nil || index < 0 {
  				return "", fmt.Errorf(
  					"invalid number for index, got %s", args[1])
  			}
  
  			resolvedIndex := index % len(list)
  
  			v := list[resolvedIndex]
  			if v.Type != ast.TypeString {
  				return nil, fmt.Errorf(
  					"element() may only be used with flat lists, this list contains elements of %s",
  					v.Type.Printable())
  			}
  			return v.Value, nil
  		},
  	}
  }
docs: // interpolationFuncElement implements the "element" function that allows
  // a specific index to be looked up in a multi-variable value. Note that this will
  // wrap if the index is larger than the number of elements in the multi-variable value.