# HG changeset patch # User wenzelm # Date 1256829333 -3600 # Node ID 53d49370f7af9d46609cd72c1887c9a5d82eda58 # Parent f6acebef3ea1a9037c45e011f5c7e600ca8e5bfc modernized functor/structures Interpretation; diff -r f6acebef3ea1 -r 53d49370f7af src/HOL/Tools/Datatype/datatype.ML --- a/src/HOL/Tools/Datatype/datatype.ML Thu Oct 29 16:09:41 2009 +0100 +++ b/src/HOL/Tools/Datatype/datatype.ML Thu Oct 29 16:15:33 2009 +0100 @@ -263,7 +263,7 @@ (** abstract theory extensions relative to a datatype characterisation **) -structure Datatype_Interpretation = InterpretationFun +structure Datatype_Interpretation = Interpretation (type T = config * string list val eq: T * T -> bool = eq_snd op =); fun interpretation f = Datatype_Interpretation.interpretation (uncurry f); diff -r f6acebef3ea1 -r 53d49370f7af src/HOL/Tools/typecopy.ML --- a/src/HOL/Tools/typecopy.ML Thu Oct 29 16:09:41 2009 +0100 +++ b/src/HOL/Tools/typecopy.ML Thu Oct 29 16:15:33 2009 +0100 @@ -44,8 +44,8 @@ (* interpretation of type copies *) -structure TypecopyInterpretation = InterpretationFun(type T = string val eq = op =); -val interpretation = TypecopyInterpretation.interpretation; +structure Typecopy_Interpretation = Interpretation(type T = string val eq = op =); +val interpretation = Typecopy_Interpretation.interpretation; (* introducing typecopies *) @@ -76,7 +76,7 @@ in thy |> (TypecopyData.map o Symtab.update_new) (tyco, info) - |> TypecopyInterpretation.data tyco + |> Typecopy_Interpretation.data tyco |> pair (tyco, info) end in @@ -126,7 +126,7 @@ end; val setup = - TypecopyInterpretation.init + Typecopy_Interpretation.init #> interpretation add_default_code end; diff -r f6acebef3ea1 -r 53d49370f7af src/HOL/Tools/typedef.ML --- a/src/HOL/Tools/typedef.ML Thu Oct 29 16:09:41 2009 +0100 +++ b/src/HOL/Tools/typedef.ML Thu Oct 29 16:15:33 2009 +0100 @@ -53,8 +53,8 @@ fun declare_type_name a = Variable.declare_constraints (Logic.mk_type (TFree (a, dummyS))); -structure TypedefInterpretation = InterpretationFun(type T = string val eq = op =); -val interpretation = TypedefInterpretation.interpretation; +structure Typedef_Interpretation = Interpretation(type T = string val eq = op =); +val interpretation = Typedef_Interpretation.interpretation; fun prepare_typedef prep_term def name (t, vs, mx) raw_set opt_morphs thy = let @@ -169,7 +169,7 @@ in thy2 |> put_info full_tname info - |> TypedefInterpretation.data full_tname + |> Typedef_Interpretation.data full_tname |> pair (full_tname, info) end); @@ -264,6 +264,6 @@ end; -val setup = TypedefInterpretation.init; +val setup = Typedef_Interpretation.init; end; diff -r f6acebef3ea1 -r 53d49370f7af src/Pure/Isar/code.ML --- a/src/Pure/Isar/code.ML Thu Oct 29 16:09:41 2009 +0100 +++ b/src/Pure/Isar/code.ML Thu Oct 29 16:15:33 2009 +0100 @@ -639,7 +639,8 @@ (* datatypes *) -structure Type_Interpretation = InterpretationFun(type T = string * serial val eq = eq_snd (op =) : T * T -> bool); +structure Type_Interpretation = + Interpretation(type T = string * serial val eq = eq_snd (op =) : T * T -> bool); fun add_datatype raw_cs thy = let diff -r f6acebef3ea1 -r 53d49370f7af src/Pure/interpretation.ML --- a/src/Pure/interpretation.ML Thu Oct 29 16:09:41 2009 +0100 +++ b/src/Pure/interpretation.ML Thu Oct 29 16:15:33 2009 +0100 @@ -13,7 +13,7 @@ val init: theory -> theory end; -functor InterpretationFun(type T val eq: T * T -> bool): INTERPRETATION = +functor Interpretation(type T val eq: T * T -> bool): INTERPRETATION = struct type T = T;