1300
|
1 |
(* Title: HOL/MiniML/Maybe.thy
|
|
2 |
ID: $Id$
|
2525
|
3 |
Author: Wolfgang Naraschewski and Tobias Nipkow
|
|
4 |
Copyright 1996 TU Muenchen
|
1300
|
5 |
|
|
6 |
Universal error monad.
|
|
7 |
*)
|
|
8 |
|
2525
|
9 |
Maybe = Option + List +
|
1300
|
10 |
|
1557
|
11 |
constdefs
|
2525
|
12 |
option_bind :: ['a option, 'a => 'b option] => 'b option
|
|
13 |
"option_bind m f == case m of None => None | Some r => f r"
|
1300
|
14 |
|
2525
|
15 |
syntax "@option_bind" :: [pttrns,'a option,'b] => 'c ("(_ := _;//_)" 0)
|
3842
|
16 |
translations "P := E; F" == "option_bind E (%P. F)"
|
1400
|
17 |
|
1300
|
18 |
end
|