sig
  type raw_error =
      CyclicDependency of Module.name
    | NotAFunction of TypeCore.var
    | ExpectedType of TypeCore.typ * TypeCore.var * Derivations.derivation
    | ExpectedPermission of TypeCore.typ * Derivations.derivation
    | RecursiveOnlyForFunctions
    | MissingField of TypeCore.Field.name
    | ExtraField of TypeCore.Field.name
    | NoSuchField of TypeCore.var * TypeCore.Field.name
    | CantAssignTag of TypeCore.var
    | NoSuchFieldInPattern of ExpressionsCore.pattern * TypeCore.Field.name
    | BadPattern of ExpressionsCore.pattern * TypeCore.var
    | BadField of Datacon.name * TypeCore.Field.name
    | NoTwoConstructors of TypeCore.var
    | MatchBadDatacon of TypeCore.var * Datacon.name
    | MatchBadTuple of TypeCore.var
    | AssignNotExclusive of TypeCore.typ * Datacon.name
    | FieldCountMismatch of TypeCore.typ * Datacon.name
    | NoMultipleArguments
    | ResourceAllocationConflict of TypeCore.var
    | UncertainMerge of TypeCore.var
    | ConflictingTypeAnnotations of TypeCore.typ * TypeCore.typ
    | IllKindedTypeApplication of ExpressionsCore.tapp * Kind.kind *
        Kind.kind
    | BadTypeApplication of TypeCore.var
    | NonExclusiveAdoptee of TypeCore.typ
    | NoAdoptsClause of TypeCore.var
    | NotDynamic of TypeCore.var
    | NoSuitableTypeForAdopts of TypeCore.var * TypeCore.typ
    | AdoptsNoAnnotation
    | NotMergingClauses of TypeCore.env * TypeCore.typ * TypeCore.typ *
        TypeCore.env * TypeCore.typ * TypeCore.typ
    | NoSuchTypeInSignature of TypeCore.var * TypeCore.typ *
        Derivations.derivation
    | DataTypeMismatchInSignature of Variable.name * string
    | VarianceAnnotationMismatch
    | ExportNotDuplicable of Variable.name
    | LocalType
    | Instantiated of Variable.name * TypeCore.typ
    | PackWithExists
    | SeveralWorkingFunctionTypes of TypeCore.var
  val parse_warn_error : string -> unit
  val raise_error : TypeCore.env -> TypeErrors.raw_error -> 'a
  val may_raise_error : TypeCore.env -> TypeErrors.raw_error -> unit
  type error
  exception TypeCheckerError of TypeErrors.error
  val print_error : Buffer.t -> TypeErrors.error -> unit
  val html_error : TypeErrors.error -> unit
  val fold_type : TypeCore.env -> TypeCore.typ -> TypeCore.typ option
  val internal_extracterror : TypeErrors.error -> TypeErrors.raw_error
end