# Functor Base.Generator

    module Generator: functor (Loc : Defs.Loc) -> functor (Desc : Defs.ClassDescription) -> Defs.Generator

Parameters:

`Loc` | : | `Defs.Loc`
`Desc` | : | `Defs.ClassDescription`

    type context

    module Loc: Defs.Loc

    module AstHelpers: Defs.AstHelpers

    val cast_pattern : context ->
           ?param:string ->
           Type.expr ->
           Camlp4.PreCast.Ast.patt * Camlp4.PreCast.Ast.expr * Camlp4.PreCast.Ast.expr

    val instantiate_modargs_repr : context -> Type.repr -> Type.repr

    class virtual generator : object .. end

    val generate : generator -> Type.decl list -> Camlp4.PreCast.Ast.str_item

    val generate_sigs : generator -> Type.decl list -> Camlp4.PreCast.Ast.sig_item

    val generate_expr : generator ->
           Camlp4.PreCast.Ast.module_expr Type.EMap.t ->
           Type.qname Type.NameMap.t -> Type.expr -> Camlp4.PreCast.Ast.module_expr