src/HOL/Datatype.thy
changeset 19890 1aad48bcc674
parent 19817 bb16bf9ae3fd
child 20105 454f4be984b7
equal deleted inserted replaced
19889:2202a5648897 19890:1aad48bcc674
   255   if_True [code fun]
   255   if_True [code fun]
   256   if_False [code fun]
   256   if_False [code fun]
   257   fst_conv [code]
   257   fst_conv [code]
   258   snd_conv [code]
   258   snd_conv [code]
   259 
   259 
   260 lemma [code unfolt]:
   260 code_typapp bool
   261   "1 == Suc 0" by simp
       
   262 
       
   263 code_syntax_tyco bool
       
   264   ml (target_atom "bool")
   261   ml (target_atom "bool")
   265   haskell (target_atom "Bool")
   262   haskell (target_atom "Bool")
   266 
   263 
   267 code_syntax_const
   264 code_constapp
   268   True
   265   True
   269     ml (target_atom "true")
   266     ml (target_atom "true")
   270     haskell (target_atom "True")
   267     haskell (target_atom "True")
   271   False
   268   False
   272     ml (target_atom "false")
   269     ml (target_atom "false")
   282     haskell (infixl 2 "||")
   279     haskell (infixl 2 "||")
   283   If
   280   If
   284     ml (target_atom "(if __/ then __/ else __)")
   281     ml (target_atom "(if __/ then __/ else __)")
   285     haskell (target_atom "(if __/ then __/ else __)")
   282     haskell (target_atom "(if __/ then __/ else __)")
   286 
   283 
   287 code_syntax_tyco
   284 code_typapp
   288   *
   285   *
   289     ml (infix 2 "*")
   286     ml (infix 2 "*")
   290     haskell (target_atom "(__,/ __)")
   287     haskell (target_atom "(__,/ __)")
   291 
   288 
   292 code_syntax_const
   289 code_constapp
   293   Pair
   290   Pair
   294     ml (target_atom "(__,/ __)")
   291     ml (target_atom "(__,/ __)")
   295     haskell (target_atom "(__,/ __)")
   292     haskell (target_atom "(__,/ __)")
   296 
   293 
   297 code_syntax_tyco
   294 code_typapp
   298   unit
   295   unit
   299     ml (target_atom "unit")
   296     ml (target_atom "unit")
   300     haskell (target_atom "()")
   297     haskell (target_atom "()")
   301 
   298 
   302 code_syntax_const
   299 code_constapp
   303   Unity
   300   Unity
   304     ml (target_atom "()")
   301     ml (target_atom "()")
   305     haskell (target_atom "()")
   302     haskell (target_atom "()")
   306 
   303 
   307 code_syntax_tyco
   304 code_typapp
   308   option
   305   option
   309     ml ("_ option")
   306     ml ("_ option")
   310     haskell ("Maybe _")
   307     haskell ("Maybe _")
   311 
   308 
   312 code_syntax_const
   309 code_constapp
   313   None
   310   None
   314     ml (target_atom "NONE")
   311     ml (target_atom "NONE")
   315     haskell (target_atom "Nothing")
   312     haskell (target_atom "Nothing")
   316   Some
   313   Some
   317     ml (target_atom "SOME")
   314     ml (target_atom "SOME")