src/Doc/Datatypes/Datatypes.thy
changeset 56995 61855ade6c7e
parent 56992 d0e5225601d3
child 57047 90d4db566e12
equal deleted inserted replaced
56994:8d5e5ec1cac3 56995:61855ade6c7e
   192 Polymorphic types are possible, such as the following option type, modeled after
   192 Polymorphic types are possible, such as the following option type, modeled after
   193 its homologue from the @{theory Option} theory:
   193 its homologue from the @{theory Option} theory:
   194 *}
   194 *}
   195 
   195 
   196 (*<*)
   196 (*<*)
   197     hide_const None Some
   197     hide_const None Some map_option
   198     hide_type option
   198     hide_type option
   199 (*>*)
   199 (*>*)
   200     datatype_new 'a option = None | Some 'a
   200     datatype_new 'a option = None | Some 'a
   201 
   201 
   202 text {*
   202 text {*
   365     no_notation
   365     no_notation
   366       Nil ("[]") and
   366       Nil ("[]") and
   367       Cons (infixr "#" 65)
   367       Cons (infixr "#" 65)
   368 
   368 
   369     hide_type list
   369     hide_type list
   370     hide_const Nil Cons hd tl set map list_all2
   370     hide_const Nil Cons hd tl set map list_all2 rec_list size_list
   371 
   371 
   372     context early begin
   372     context early begin
   373 (*>*)
   373 (*>*)
   374     datatype_new (set: 'a) list (map: map rel: list_all2) =
   374     datatype_new (set: 'a) list (map: map rel: list_all2) =
   375       null: Nil (defaults tl: Nil)
   375       null: Nil (defaults tl: Nil)