src/Pure/library.ML
changeset 40318 035b2afbeb2e
parent 40291 012ed4426fda
child 40509 0bc83ae22789
equal deleted inserted replaced
40317:1eac228c52b3 40318:035b2afbeb2e
    27   val oooo: ('a -> 'b) * ('c -> 'd -> 'e -> 'f -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'b
    27   val oooo: ('a -> 'b) * ('c -> 'd -> 'e -> 'f -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'b
    28   val funpow: int -> ('a -> 'a) -> 'a -> 'a
    28   val funpow: int -> ('a -> 'a) -> 'a -> 'a
    29   val funpow_yield: int -> ('a -> 'b * 'a) -> 'a -> 'b list * 'a
    29   val funpow_yield: int -> ('a -> 'b * 'a) -> 'a -> 'b list * 'a
    30 
    30 
    31   (*errors*)
    31   (*errors*)
    32   exception SYS_ERROR of string
       
    33   val sys_error: string -> 'a
       
    34   exception ERROR of string
    32   exception ERROR of string
    35   val error: string -> 'a
    33   val error: string -> 'a
    36   val cat_error: string -> string -> 'a
    34   val cat_error: string -> string -> 'a
    37   val assert_all: ('a -> bool) -> 'a list -> ('a -> string) -> unit
    35   val assert_all: ('a -> bool) -> 'a list -> ('a -> string) -> unit
    38 
    36 
   254   | funpow n f = f #> funpow (n - 1) f;
   252   | funpow n f = f #> funpow (n - 1) f;
   255 
   253 
   256 fun funpow_yield (0 : int) _ x = ([], x)
   254 fun funpow_yield (0 : int) _ x = ([], x)
   257   | funpow_yield n f x = x |> f ||>> funpow_yield (n - 1) f |>> op ::;
   255   | funpow_yield n f x = x |> f ||>> funpow_yield (n - 1) f |>> op ::;
   258 
   256 
       
   257 
   259 (* errors *)
   258 (* errors *)
   260 
       
   261 exception SYS_ERROR of string;
       
   262 fun sys_error msg = raise SYS_ERROR msg;
       
   263 
   259 
   264 exception ERROR of string;
   260 exception ERROR of string;
   265 fun error msg = raise ERROR msg;
   261 fun error msg = raise ERROR msg;
   266 
   262 
   267 fun cat_error "" msg = error msg
   263 fun cat_error "" msg = error msg