================================================================================
External functions
================================================================================

external fn read_file(String) -> Result(String, Reason) =
  "file" "open"
external fn a(name: String) -> String = "x" "y"
external fn a() -> #(List(Int), fn(Int) -> String) = "x" "y"

--------------------------------------------------------------------------------

(source_file
  (external_function
    name: (identifier)
    parameters: (function_parameters
      (function_parameter
        type: (type
          name: (type_identifier))))
    return_type: (type
      name: (type_identifier)
      arguments: (type_arguments
        (type_argument
          (type
            name: (type_identifier)))
        (type_argument
          (type
            name: (type_identifier)))))
    body: (external_function_body
      (string
        (quoted_content))
      (string
        (quoted_content))))
  (external_function
    name: (identifier)
    parameters: (function_parameters
      (function_parameter
        name: (identifier)
        type: (type
          name: (type_identifier))))
    return_type: (type
      name: (type_identifier))
    body: (external_function_body
      (string
        (quoted_content))
      (string
        (quoted_content))))
  (external_function
    name: (identifier)
    parameters: (function_parameters)
    return_type: (tuple_type
      (type
        name: (type_identifier)
        arguments: (type_arguments
          (type_argument
            (type
              name: (type_identifier)))))
      (function_type
        parameter_types: (function_parameter_types
          (type
            name: (type_identifier)))
        return_type: (type
          name: (type_identifier))))
    body: (external_function_body
      (string
        (quoted_content))
      (string
        (quoted_content)))))

================================================================================
Public external functions
================================================================================

pub external fn read_file(String) -> Result(String, Reason) =
  "file" "open"
pub external fn a(name: String) -> String = "x" "y"
pub external fn a() -> #(List(Int), fn(Int) -> String) = "x" "y"

--------------------------------------------------------------------------------

(source_file
  (external_function
    (visibility_modifier)
    name: (identifier)
    parameters: (function_parameters
      (function_parameter
        type: (type
          name: (type_identifier))))
    return_type: (type
      name: (type_identifier)
      arguments: (type_arguments
        (type_argument
          (type
            name: (type_identifier)))
        (type_argument
          (type
            name: (type_identifier)))))
    body: (external_function_body
      (string
        (quoted_content))
      (string
        (quoted_content))))
  (external_function
    (visibility_modifier)
    name: (identifier)
    parameters: (function_parameters
      (function_parameter
        name: (identifier)
        type: (type
          name: (type_identifier))))
    return_type: (type
      name: (type_identifier))
    body: (external_function_body
      (string
        (quoted_content))
      (string
        (quoted_content))))
  (external_function
    (visibility_modifier)
    name: (identifier)
    parameters: (function_parameters)
    return_type: (tuple_type
      (type
        name: (type_identifier)
        arguments: (type_arguments
          (type_argument
            (type
              name: (type_identifier)))))
      (function_type
        parameter_types: (function_parameter_types
          (type
            name: (type_identifier)))
        return_type: (type
          name: (type_identifier))))
    body: (external_function_body
      (string
        (quoted_content))
      (string
        (quoted_content)))))
