X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=code%2Fmonads.ml;h=10ef808eb1d025132bedc605551e79a11f919d56;hp=8b69ec1d1a0a909b62ae7353b3487e6c642169d5;hb=ec3295573e97fa652e7f917c971d9023fbe0addc;hpb=ac9bb9b364bba01ec8fe55fa9cf413d7400e8841 diff --git a/code/monads.ml b/code/monads.ml index 8b69ec1d..10ef808e 100644 --- a/code/monads.ml +++ b/code/monads.ml @@ -55,9 +55,11 @@ * derived from) *) -exception Undefined (* Some library functions used below. *) + +exception Undefined + module Util = struct let fold_right = List.fold_right let map = List.map @@ -78,14 +80,13 @@ module Util = struct let undef = Obj.magic (fun () -> raise Undefined) end - - (* * This module contains factories that extend a base set of * monadic definitions with a larger family of standard derived values. *) module Monad = struct + (* * Signature extenders: * Make :: BASE -> S @@ -1037,6 +1038,7 @@ end = struct let distribute f t = mapT (fun a -> elevate (f a)) t zero plus let expose u = u end + end;;