src/Pure/library.ML
changeset 4995 905cd6f73429
parent 4956 a7538e43896e
child 5037 224887671646
equal deleted inserted replaced
4994:8b361563d470 4995:905cd6f73429
   237   val bump_int_list: string list -> string list
   237   val bump_int_list: string list -> string list
   238   val bump_list: string list * string -> string list
   238   val bump_list: string list * string -> string list
   239   val bump_string: string -> string
   239   val bump_string: string -> string
   240   val scanwords: (string -> bool) -> string list -> string list
   240   val scanwords: (string -> bool) -> string list -> string list
   241   datatype 'a mtree = Join of 'a * 'a mtree list
   241   datatype 'a mtree = Join of 'a * 'a mtree list
   242   type object
       
   243   val type_error: string -> 'a
       
   244 end;
   242 end;
   245 
   243 
   246 structure Library: LIBRARY =
   244 structure Library: LIBRARY =
   247 struct
   245 struct
       
   246 
   248 
   247 
   249 (** functions **)
   248 (** functions **)
   250 
   249 
   251 (*handy combinators*)
   250 (*handy combinators*)
   252 fun curry f x y = f (x, y);
   251 fun curry f x y = f (x, y);
  1250 
  1249 
  1251 (* Variable-branching trees: for proof terms etc. *)
  1250 (* Variable-branching trees: for proof terms etc. *)
  1252 datatype 'a mtree = Join of 'a * 'a mtree list;
  1251 datatype 'a mtree = Join of 'a * 'a mtree list;
  1253 
  1252 
  1254 
  1253 
  1255 (* generic objects -- fool the ML type system via exception constructors *)
       
  1256 
       
  1257 type object = exn;
       
  1258 
       
  1259 fun type_error name =
       
  1260   error ("## RUNTIME TYPE ERROR ##\nFailed to access " ^ quote name ^ " data");
       
  1261 
       
  1262 
       
  1263 end;
  1254 end;
  1264 
  1255 
  1265 open Library;
  1256 open Library;