author | wenzelm |
Mon, 30 Mar 2009 22:38:50 +0200 | |
changeset 30804 | dbdb74be8dde |
parent 30663 | 0b6aff7451b2 |
child 31046 | c1969f609bf7 |
permissions | -rw-r--r-- |
24999 | 1 |
(* Title: HOL/Library/Code_Char.thy |
2 |
Author: Florian Haftmann |
|
3 |
*) |
|
4 |
||
5 |
header {* Code generation of pretty characters (and strings) *} |
|
6 |
||
7 |
theory Code_Char |
|
30663
0b6aff7451b2
Main is (Complex_Main) base entry point in library theories
haftmann
parents:
30007
diff
changeset
|
8 |
imports List Code_Eval Main |
24999 | 9 |
begin |
10 |
||
11 |
code_type char |
|
12 |
(SML "char") |
|
13 |
(OCaml "char") |
|
14 |
(Haskell "Char") |
|
15 |
||
16 |
setup {* |
|
28090
29af3c712d2b
distributed literal code generation out of central infrastructure
haftmann
parents:
28064
diff
changeset
|
17 |
fold (fn target => add_literal_char target) ["SML", "OCaml", "Haskell"] |
29af3c712d2b
distributed literal code generation out of central infrastructure
haftmann
parents:
28064
diff
changeset
|
18 |
#> add_literal_list_string "Haskell" |
24999 | 19 |
*} |
20 |
||
21 |
code_instance char :: eq |
|
22 |
(Haskell -) |
|
23 |
||
24 |
code_reserved SML |
|
25 |
char |
|
26 |
||
27 |
code_reserved OCaml |
|
28 |
char |
|
29 |
||
28346
b8390cd56b8f
discontinued special treatment of op = vs. eq_class.eq
haftmann
parents:
28244
diff
changeset
|
30 |
code_const "eq_class.eq \<Colon> char \<Rightarrow> char \<Rightarrow> bool" |
24999 | 31 |
(SML "!((_ : char) = _)") |
32 |
(OCaml "!((_ : char) = _)") |
|
33 |
(Haskell infixl 4 "==") |
|
34 |
||
28228 | 35 |
code_const "Code_Eval.term_of \<Colon> char \<Rightarrow> term" |
36 |
(SML "HOLogic.mk'_char/ (IntInf.fromInt/ (Char.ord/ _))") |
|
37 |
||
24999 | 38 |
end |