# HG changeset patch # User traytel # Date 1288697832 -3600 # Node ID c753e3f8b4d6d5a3551a81b054c301cc5302b9dc # Parent ac4d75f86d97d6aea40878d47fe194d4245cf01b Attribute map_function -> coercion_map; tuned; diff -r ac4d75f86d97 -r c753e3f8b4d6 src/HOL/ex/Coercion_Examples.thy --- a/src/HOL/ex/Coercion_Examples.thy Sun Oct 31 13:26:37 2010 +0100 +++ b/src/HOL/ex/Coercion_Examples.thy Tue Nov 02 12:37:12 2010 +0100 @@ -11,7 +11,7 @@ setup Subtyping.setup -(* Coercion/type maps definitions*) +(* Error messages test *) consts func :: "(nat \ int) \ nat" consts arg :: "int \ nat" @@ -36,6 +36,8 @@ term "[1::int] = func" *) +(* Coercion/type maps definitions *) + primrec nat_of_bool :: "bool \ nat" where "nat_of_bool False = 0" @@ -45,17 +47,17 @@ declare [[coercion int]] -declare [[map_function map]] +declare [[coercion_map map]] definition map_fun :: "('a \ 'b) \ ('c \ 'd) \ ('b \ 'c) \ ('a \ 'd)" where "map_fun f g h = g o h o f" -declare [[map_function "\ f g h . g o h o f"]] +declare [[coercion_map "\ f g h . g o h o f"]] primrec map_pair :: "('a \ 'c) \ ('b \ 'd) \ ('a * 'b) \ ('c * 'd)" where "map_pair f g (x,y) = (f x, g y)" -declare [[map_function map_pair]] +declare [[coercion_map map_pair]] (* Examples taken from the haskell draft implementation *) diff -r ac4d75f86d97 -r c753e3f8b4d6 src/Tools/subtyping.ML --- a/src/Tools/subtyping.ML Sun Oct 31 13:26:37 2010 +0100 +++ b/src/Tools/subtyping.ML Tue Nov 02 12:37:12 2010 +0100 @@ -762,7 +762,7 @@ Attrib.setup @{binding coercion} (Args.term >> (fn t => Thm.declaration_attribute (K (add_coercion t)))) "declaration of new coercions" #> - Attrib.setup @{binding map_function} + Attrib.setup @{binding coercion_map} (Args.term >> (fn t => Thm.declaration_attribute (K (add_type_map t)))) "declaration of new map functions";