Do you mean something like this?
let g = function 0 -> raise G | n -> n
let f = function 1 -> raise F | n -> n
map f (map g [1;0]) ===> raise G
map (f %> g) [1;0] ===> raise F
It is true, the exception prevents any optimization that would reorder
two functions that both throw an excepition.
But many other
optimizations are still possible, e.g. common subexpression
elimination:
let n =
let x = f (g 1) in
let y = g 1 in
x + y
==>
let n =
let t = g 1 in
let x = f t in
let y = t in
x + y
MfG
Goswin
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs