src/HOL/MiniML/Maybe.thy
author nipkow
Wed Oct 25 09:46:46 1995 +0100 (1995-10-25)
changeset 1300 c7a8f374339b
child 1376 92f83b9d17e1
permissions -rw-r--r--
New theory: type inference for let-free MiniML
     1 (* Title:     HOL/MiniML/Maybe.thy
     2    ID:        $Id$
     3    Author:    Dieter Nazareth and Tobias Nipkow
     4    Copyright  1995 TU Muenchen
     5 
     6 Universal error monad.
     7 *)
     8 
     9 Maybe = List +
    10 
    11 datatype 'a maybe =  Ok 'a | Fail
    12 
    13 consts bind :: "['a maybe, 'a => 'b maybe] => 'b maybe" (infixl 60)
    14 
    15 defs
    16   bind_def "m bind f == case m of Ok r => f r | Fail => Fail"
    17 
    18 end