src/HOL/Option.thy
author oheimb
Mon Nov 10 14:57:31 1997 +0100 (1997-11-10)
changeset 4192 c38ab5af38b5
parent 4133 0a08c2b9b1ed
child 4752 1c334bd00038
permissions -rw-r--r--
replaced 8bit characters
nipkow@2019
     1
(*  Title:      Option.thy
nipkow@2019
     2
    ID:         $Id$
nipkow@2019
     3
    Author:     Tobias Nipkow
nipkow@2019
     4
    Copyright   1994  TU Muenchen
nipkow@2019
     5
nipkow@2019
     6
Datatype 'a option
nipkow@2019
     7
*)
nipkow@2019
     8
nipkow@2019
     9
Option = Arith +
oheimb@4133
    10
nipkow@2019
    11
datatype 'a option = None | Some 'a
oheimb@4133
    12
oheimb@4133
    13
constdefs
oheimb@4133
    14
oheimb@4133
    15
  the		:: "'a option => 'a"
oheimb@4192
    16
 "the == %y. case y of None => arbitrary | Some x => x"
oheimb@4133
    17
oheimb@4133
    18
  option_map	:: "('a => 'b) => ('a option => 'b option)"
oheimb@4192
    19
 "option_map == %f y. case y of None => None | Some x => Some (f x)"
oheimb@4133
    20
nipkow@2019
    21
end