src/HOL/MiniML/Maybe.thy
author clasohm
Fri Dec 01 12:03:13 1995 +0100 (1995-12-01)
changeset 1376 92f83b9d17e1
parent 1300 c7a8f374339b
child 1400 5d909faf0e04
permissions -rw-r--r--
removed quotes from consts and syntax sections
nipkow@1300
     1
(* Title:     HOL/MiniML/Maybe.thy
nipkow@1300
     2
   ID:        $Id$
nipkow@1300
     3
   Author:    Dieter Nazareth and Tobias Nipkow
nipkow@1300
     4
   Copyright  1995 TU Muenchen
nipkow@1300
     5
nipkow@1300
     6
Universal error monad.
nipkow@1300
     7
*)
nipkow@1300
     8
nipkow@1300
     9
Maybe = List +
nipkow@1300
    10
nipkow@1300
    11
datatype 'a maybe =  Ok 'a | Fail
nipkow@1300
    12
clasohm@1376
    13
consts bind :: ['a maybe, 'a => 'b maybe] => 'b maybe (infixl 60)
nipkow@1300
    14
nipkow@1300
    15
defs
nipkow@1300
    16
  bind_def "m bind f == case m of Ok r => f r | Fail => Fail"
nipkow@1300
    17
nipkow@1300
    18
end