>>45
僕の考えた低速そうなアルゴリズムはこうです。

fun expMul nil = nil
| expMul (h::nil) = [h]
| expMul (h::rest) = h::expMul(cut(h,rest))
and cut (x,nil) = nil
| cut (x,(h::nil)) = if x=h then nil else [h]
| cut (x,(h,rest)) =if x=h then cut(x,b) else h::cut(x,b);