src/HOL/Option.thy
author wenzelm
Thu Mar 11 13:20:35 1999 +0100 (1999-03-11)
changeset 6349 f7750d816c21
parent 5445 3905974ad555
child 9001 93af64f54bf2
permissions -rw-r--r--
removed foo_build_completed -- now handled by session management (via usedir);
     1 (*  Title:      Option.thy
     2     ID:         $Id$
     3     Author:     Tobias Nipkow
     4     Copyright   1994  TU Muenchen
     5 
     6 Datatype 'a option
     7 *)
     8 
     9 Option = Datatype +
    10 
    11 datatype 'a option = None | Some 'a
    12 
    13 constdefs
    14 
    15   the		:: "'a option => 'a"
    16  "the == %y. case y of None => arbitrary | Some x => x"
    17 
    18   option_map	:: "('a => 'b) => ('a option => 'b option)"
    19  "option_map == %f y. case y of None => None | Some x => Some (f x)"
    20 
    21 consts
    22 
    23   o2s	   :: "'a option => 'a set"
    24 
    25 primrec
    26 
    27  "o2s  None    = {}"
    28  "o2s (Some x) = {x}"
    29 
    30 end