src/Pure/General/path.ML
changeset 15531 08c8dad8e399
parent 14981 e73f8140af78
child 15570 8d8c70b41bab
equal deleted inserted replaced
15530:6f43714517ee 15531:08c8dad8e399
   128 
   128 
   129 (* base element *)
   129 (* base element *)
   130 
   130 
   131 fun split_path f (path as Path xs) =
   131 fun split_path f (path as Path xs) =
   132   (case try split_last xs of
   132   (case try split_last xs of
   133     Some (prfx, Basic s) => f (prfx, s)
   133     SOME (prfx, Basic s) => f (prfx, s)
   134   | _ => error ("Cannot split path into dir/base: " ^ quote (pack path)));
   134   | _ => error ("Cannot split path into dir/base: " ^ quote (pack path)));
   135 
   135 
   136 val dir = split_path (fn (prfx, _) => Path prfx);
   136 val dir = split_path (fn (prfx, _) => Path prfx);
   137 val base = split_path (fn (_, s) => Path [Basic s]);
   137 val base = split_path (fn (_, s) => Path [Basic s]);
   138 
   138