let rec reduce_gdecl ~env decl =
  match decl with
    CTTdeclFunction(gsclass, typ, ident, argnames, body) ->
      let new_type = convert_type typ in
      let new_body = reduce_statement ~env body in
      CTTdeclFunction(gsclass, new_type, ident, argnames, new_body)
  | CTTdeclVariable(gsclass, typ, ident, initopt) ->
      CTTdeclVariable(gsclass, convert_type typ, ident, Option.map (reduce_initializer ~env ~typ) initopt)