src/HOL/Tools/datatype_hooks.ML
changeset 24626 85eceef2edc7
parent 24625 0398a5e802d3
child 24627 cc6768509ed3
     1.1 --- a/src/HOL/Tools/datatype_hooks.ML	Tue Sep 18 07:36:38 2007 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,35 +0,0 @@
     1.4 -(*  Title:      HOL/Tools/datatype_hooks.ML
     1.5 -    ID:         $Id$
     1.6 -    Author:     Florian Haftmann, TU Muenchen
     1.7 -
     1.8 -Hooks for datatype introduction.
     1.9 -*)
    1.10 -
    1.11 -signature DATATYPE_HOOKS =
    1.12 -sig
    1.13 -  type hook = string list -> theory -> theory
    1.14 -  val add: hook -> theory -> theory
    1.15 -  val all: hook
    1.16 -end;
    1.17 -
    1.18 -structure DatatypeHooks : DATATYPE_HOOKS =
    1.19 -struct
    1.20 -
    1.21 -type hook = string list -> theory -> theory;
    1.22 -
    1.23 -structure DatatypeHooksData = TheoryDataFun
    1.24 -(
    1.25 -  type T = (serial * hook) list;
    1.26 -  val empty = [];
    1.27 -  val copy = I;
    1.28 -  val extend = I;
    1.29 -  fun merge _ hooks : T = AList.merge (op =) (K true) hooks;
    1.30 -);
    1.31 -
    1.32 -fun add hook =
    1.33 -  DatatypeHooksData.map (cons (serial (), hook));
    1.34 -
    1.35 -fun all dtcos thy =
    1.36 -  fold_rev (fn (_, f) => f dtcos) (DatatypeHooksData.get thy) thy;
    1.37 -
    1.38 -end;