equal
deleted
inserted
replaced
|
1 (* Title: HOL/Library/Datatype_Records.thy |
|
2 Author: Lars Hupel |
|
3 *) |
|
4 |
1 section \<open>Records based on BNF/datatype machinery\<close> |
5 section \<open>Records based on BNF/datatype machinery\<close> |
2 |
6 |
3 theory Datatype_Records |
7 theory Datatype_Records |
4 imports Main |
8 imports Main |
5 keywords "datatype_record" :: thy_decl |
9 keywords "datatype_record" :: thy_decl |
6 begin |
10 begin |
|
11 |
|
12 text \<open> |
|
13 This theory provides an alternative, stripped-down implementation of records based on the |
|
14 machinery of the @{command datatype} package. |
|
15 |
|
16 It supports: |
|
17 \<^item> similar declaration syntax as records |
|
18 \<^item> record creation and update syntax (using \<open>\<lparr> ... \<rparr>\<close> brackets) |
|
19 \<^item> regular datatype features (e.g. dead type variables etc.) |
|
20 \<^item> ``after-the-fact'' registration of single-free-constructor types as records |
|
21 \<close> |
|
22 |
|
23 text \<open> |
|
24 Caveats: |
|
25 \<^item> there is no compatibility layer; importing this theory will disrupt existing syntax |
|
26 \<^item> extensible records are not supported |
|
27 \<close> |
7 |
28 |
8 no_syntax |
29 no_syntax |
9 "_constify" :: "id => ident" ("_") |
30 "_constify" :: "id => ident" ("_") |
10 "_constify" :: "longid => ident" ("_") |
31 "_constify" :: "longid => ident" ("_") |
11 |
32 |