6549
|
1 |
(* Title: Pure/Isar/comment.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Markus Wenzel, TU Muenchen
|
|
4 |
|
|
5 |
Formal comments.
|
|
6 |
*)
|
|
7 |
|
|
8 |
signature COMMENT =
|
|
9 |
sig
|
|
10 |
type text
|
|
11 |
val plain: string -> text
|
6725
|
12 |
val none: text
|
|
13 |
val ignore: 'a * text -> 'a
|
6549
|
14 |
type interest
|
7171
|
15 |
val interest: int -> interest
|
6549
|
16 |
val no_interest: interest
|
|
17 |
val default_interest: interest
|
6725
|
18 |
val ignore_interest: 'a * interest -> 'a
|
|
19 |
val ignore_interest': interest * 'a -> 'a
|
6549
|
20 |
end;
|
|
21 |
|
|
22 |
structure Comment: COMMENT =
|
|
23 |
struct
|
|
24 |
|
|
25 |
(** text **)
|
|
26 |
|
|
27 |
datatype text = Text of string;
|
|
28 |
val plain = Text;
|
6725
|
29 |
val none = plain "";
|
|
30 |
|
|
31 |
fun ignore (x, _) = x;
|
|
32 |
|
6549
|
33 |
|
|
34 |
|
|
35 |
(** interest **)
|
|
36 |
|
7171
|
37 |
datatype interest = Interest of int;
|
|
38 |
val interest = Interest;
|
|
39 |
val no_interest = interest ~1;
|
|
40 |
val default_interest = interest 0;
|
6549
|
41 |
|
6725
|
42 |
fun ignore_interest (x, _) = x;
|
|
43 |
fun ignore_interest' (_, x) = x;
|
|
44 |
|
|
45 |
|
6549
|
46 |
end;
|