compilation_unit {
  package_statement {
    package_name: "ExplorerTest"
  }
  is_api: true
  declarations {
    interface {
      name {
        name: "Hashable"
      }
      members {
        function {
          name {
            name: "Hash"
          }
          self_pattern {
            binding_pattern {
              name: "self"
              type {
                expression_pattern {
                  expression {
                    identifier {
                      name: "Self"
                    }
                  }
                }
              }
            }
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              int_type_literal {
              }
            }
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name {
        name: "Potato"
      }
      members {
        impl {
          kind: ExternalImpl
          impl_type {
            identifier {
              name: "Self"
            }
          }
          interface {
            identifier {
              name: "Hashable"
            }
          }
          members {
            function {
              name {
                name: "Hash"
              }
              self_pattern {
                binding_pattern {
                  name: "self"
                  type {
                    expression_pattern {
                      expression {
                        identifier {
                          name: "Self"
                        }
                      }
                    }
                  }
                }
              }
              param_pattern {
              }
              return_term {
                kind: Expression
                type {
                  int_type_literal {
                  }
                }
              }
              body {
                statements {
                  expression_statement {
                    expression {
                      call {
                        function {
                          identifier {
                            name: "Print"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              string_literal {
                                value: "Potato.(Hashable.Hash)"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                statements {
                  return_expression_statement {
                    expression {
                      int_literal {
                        value: 1
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "Hash"
          }
          self_pattern {
            binding_pattern {
              name: "self"
              type {
                expression_pattern {
                  expression {
                    identifier {
                      name: "Self"
                    }
                  }
                }
              }
            }
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              int_type_literal {
              }
            }
          }
          body {
            statements {
              expression_statement {
                expression {
                  call {
                    function {
                      identifier {
                        name: "Print"
                      }
                    }
                    argument {
                      tuple_literal {
                        fields {
                          string_literal {
                            value: "Potato.Hash"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            statements {
              return_expression_statement {
                expression {
                  int_literal {
                    value: 2
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    interface {
      name {
        name: "Maker"
      }
      members {
        let {
          pattern {
            generic_binding {
              name: "Result"
              type {
                identifier {
                  name: "Hashable"
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "Make"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "Result"
              }
            }
          }
        }
      }
    }
  }
  declarations {
    impl {
      kind: ExternalImpl
      impl_type {
        int_type_literal {
        }
      }
      interface {
        identifier {
          name: "Hashable"
        }
      }
      members {
        function {
          name {
            name: "Hash"
          }
          self_pattern {
            binding_pattern {
              name: "self"
              type {
                expression_pattern {
                  expression {
                    identifier {
                      name: "Self"
                    }
                  }
                }
              }
            }
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              int_type_literal {
              }
            }
          }
          body {
            statements {
              expression_statement {
                expression {
                  call {
                    function {
                      identifier {
                        name: "Print"
                      }
                    }
                    argument {
                      tuple_literal {
                        fields {
                          string_literal {
                            value: "i32.Hash"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            statements {
              return_expression_statement {
                expression {
                  identifier {
                    name: "self"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "F"
      }
      deduced_parameters {
        name: "T"
        type {
          where {
            base {
              identifier {
                name: "Maker"
              }
            }
            clauses {
              rewrite {
                member_name: "Result"
                replacement {
                  int_type_literal {
                  }
                }
              }
            }
          }
        }
      }
      param_pattern {
        fields {
          binding_pattern {
            name: "x"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          return_expression_statement {
            expression {
              operator {
                op: Add
                arguments {
                  call {
                    function {
                      simple_member_access {
                        field: "Make"
                        object {
                          identifier {
                            name: "T"
                          }
                        }
                      }
                    }
                    argument {
                      tuple_literal {
                      }
                    }
                  }
                }
                arguments {
                  int_literal {
                    value: 1
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "G"
      }
      deduced_parameters {
        name: "T"
        type {
          identifier {
            name: "Maker"
          }
        }
      }
      param_pattern {
        fields {
          binding_pattern {
            name: "x"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  simple_member_access {
                    field: "Hash"
                    object {
                      call {
                        function {
                          simple_member_access {
                            field: "Make"
                            object {
                              identifier {
                                name: "T"
                              }
                            }
                          }
                        }
                        argument {
                          tuple_literal {
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "H"
      }
      deduced_parameters {
        name: "T"
        type {
          where {
            base {
              identifier {
                name: "Maker"
              }
            }
            clauses {
              rewrite {
                member_name: "Result"
                replacement {
                  identifier {
                    name: "Potato"
                  }
                }
              }
            }
          }
        }
      }
      param_pattern {
        fields {
          binding_pattern {
            name: "x"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  simple_member_access {
                    field: "Hash"
                    object {
                      call {
                        function {
                          simple_member_access {
                            field: "Make"
                            object {
                              identifier {
                                name: "T"
                              }
                            }
                          }
                        }
                        argument {
                          tuple_literal {
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "I"
      }
      deduced_parameters {
        name: "T"
        type {
          where {
            base {
              identifier {
                name: "Maker"
              }
            }
            clauses {
              rewrite {
                member_name: "Result"
                replacement {
                  identifier {
                    name: "Potato"
                  }
                }
              }
            }
          }
        }
      }
      param_pattern {
        fields {
          binding_pattern {
            name: "x"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "p"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "Potato"
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
              }
            }
            is_returned: false
          }
        }
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  simple_member_access {
                    field: "Hash"
                    object {
                      identifier {
                        name: "p"
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name {
        name: "IntFactory"
      }
      members {
        impl {
          kind: InternalImpl
          impl_type {
            identifier {
              name: "Self"
            }
          }
          interface {
            where {
              base {
                identifier {
                  name: "Maker"
                }
              }
              clauses {
                rewrite {
                  member_name: "Result"
                  replacement {
                    int_type_literal {
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name {
                name: "Make"
              }
              param_pattern {
              }
              return_term {
                kind: Expression
                type {
                  int_type_literal {
                  }
                }
              }
              body {
                statements {
                  return_expression_statement {
                    expression {
                      int_literal {
                        value: 0
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name {
        name: "PotatoFactory"
      }
      members {
        impl {
          kind: InternalImpl
          impl_type {
            identifier {
              name: "Self"
            }
          }
          interface {
            where {
              base {
                identifier {
                  name: "Maker"
                }
              }
              clauses {
                rewrite {
                  member_name: "Result"
                  replacement {
                    identifier {
                      name: "Potato"
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name {
                name: "Make"
              }
              param_pattern {
              }
              return_term {
                kind: Expression
                type {
                  identifier {
                    name: "Potato"
                  }
                }
              }
              body {
                statements {
                  return_expression_statement {
                    expression {
                      struct_literal {
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "Main"
      }
      param_pattern {
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "f"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "IntFactory"
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
              }
            }
            is_returned: false
          }
        }
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "g"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "PotatoFactory"
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
              }
            }
            is_returned: false
          }
        }
        statements {
          expression_statement {
            expression {
              call {
                function {
                  identifier {
                    name: "Print"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      string_literal {
                        value: "{0}"
                      }
                    }
                    fields {
                      call {
                        function {
                          identifier {
                            name: "F"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              identifier {
                                name: "f"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          expression_statement {
            expression {
              call {
                function {
                  identifier {
                    name: "Print"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      string_literal {
                        value: "{0}"
                      }
                    }
                    fields {
                      call {
                        function {
                          identifier {
                            name: "G"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              identifier {
                                name: "f"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          expression_statement {
            expression {
              call {
                function {
                  identifier {
                    name: "Print"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      string_literal {
                        value: "{0}"
                      }
                    }
                    fields {
                      call {
                        function {
                          identifier {
                            name: "G"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              identifier {
                                name: "g"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          expression_statement {
            expression {
              call {
                function {
                  identifier {
                    name: "Print"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      string_literal {
                        value: "{0}"
                      }
                    }
                    fields {
                      call {
                        function {
                          identifier {
                            name: "H"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              identifier {
                                name: "g"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          expression_statement {
            expression {
              call {
                function {
                  identifier {
                    name: "Print"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      string_literal {
                        value: "{0}"
                      }
                    }
                    fields {
                      call {
                        function {
                          identifier {
                            name: "I"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              identifier {
                                name: "g"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          return_expression_statement {
            expression {
              int_literal {
                value: 0
              }
            }
          }
        }
      }
    }
  }
}
