src/HOL/Library/Phantom_Type.thy
changeset 52147 9943f8067f11
parent 52143 36ffe23b25f8
child 58249 180f1b3508ed
equal deleted inserted replaced
52146:ceb31e1ded30 52147:9943f8067f11
    27 translations
    27 translations
    28   "Phantom('t)" => "CONST phantom :: _ \<Rightarrow> ('t, _) phantom"
    28   "Phantom('t)" => "CONST phantom :: _ \<Rightarrow> ('t, _) phantom"
    29 
    29 
    30 typed_print_translation {*
    30 typed_print_translation {*
    31   let
    31   let
    32     fun phantom_tr' ctxt 
    32     fun phantom_tr' ctxt (Type (@{type_name fun}, [_, Type (@{type_name phantom}, [T, _])])) ts =
    33         (Type (@{type_name fun}, [_, Type (@{type_name phantom}, [T, _])])) ts =
    33           list_comb
    34           list_comb (Syntax.const @{syntax_const "_Phantom"} $ Syntax_Phases.term_of_typ ctxt T, ts)
    34             (Syntax.const @{syntax_const "_Phantom"} $ Syntax_Phases.term_of_typ ctxt T, ts)
    35     | phantom_tr' _ _ _ = raise Match;
    35       | phantom_tr' _ _ _ = raise Match;
    36   in [(@{const_syntax phantom}, phantom_tr')] end
    36   in [(@{const_syntax phantom}, phantom_tr')] end
    37 *}
    37 *}
    38 
    38 
    39 end
    39 end