src/HOL/Code_Generator.thy
changeset 21404 eb85850d3eb7
parent 21378 cedfce6fc725
child 21454 a1937c51ed88
equal deleted inserted replaced
21403:dd58f13a8eb4 21404:eb85850d3eb7
   173 *}
   173 *}
   174 
   174 
   175 text {* lazy @{const If} *}
   175 text {* lazy @{const If} *}
   176 
   176 
   177 definition
   177 definition
   178   if_delayed :: "bool \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> 'a"
   178   if_delayed :: "bool \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> 'a" where
   179   "if_delayed b f g = (if b then f True else g False)"
   179   "if_delayed b f g = (if b then f True else g False)"
   180 
   180 
   181 lemma [code func]:
   181 lemma [code func]:
   182   shows "if_delayed True f g = f True"
   182   shows "if_delayed True f g = f True"
   183     and "if_delayed False f g = g False"
   183     and "if_delayed False f g = g False"