func generateTypes(w io.Writer, s *schema.Schema) {
	out := fmt.Fprintf
	out(w, "-- TYPES\n\n")
	for _, t := range s.TypesSlice() {
		name := format.GoName(t.Name)
		out(w, "{-| %s %s -}\n", name, t.Description)
		out(w, "type alias %s =\n", name)
		writeFields(w, s, t.Properties)
		out(w, "\n\n")
	}
}
generateTypes writes types to w.
package elmclient
import (
	"fmt"
	"io"
	"strings"
	"github.com/apex/rpc/internal/format"
	"github.com/apex/rpc/internal/schemautil"
	"github.com/apex/rpc/schema"
)
var module = `
-- Do not edit, this file was generated by github.com/apex/rpc.
`
func Generate(w io.Writer, s *schema.Schema) error {
	fmt.Fprintf(w, module)
	generateTypes(w, s)
	generateMethodTypes(w, s)
	generateMethodFuncs(w, s)
	generateDecoderFuncs(w, s)
	return nil
}