src/HOL/MiniML/Maybe.thy
changeset 1300 c7a8f374339b
child 1376 92f83b9d17e1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/MiniML/Maybe.thy	Wed Oct 25 09:46:46 1995 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +(* Title:     HOL/MiniML/Maybe.thy
     1.5 +   ID:        $Id$
     1.6 +   Author:    Dieter Nazareth and Tobias Nipkow
     1.7 +   Copyright  1995 TU Muenchen
     1.8 +
     1.9 +Universal error monad.
    1.10 +*)
    1.11 +
    1.12 +Maybe = List +
    1.13 +
    1.14 +datatype 'a maybe =  Ok 'a | Fail
    1.15 +
    1.16 +consts bind :: "['a maybe, 'a => 'b maybe] => 'b maybe" (infixl 60)
    1.17 +
    1.18 +defs
    1.19 +  bind_def "m bind f == case m of Ok r => f r | Fail => Fail"
    1.20 +
    1.21 +end