[MLton] MLton.IntInf

Jens Axel Søgaard jensaxel@soegaard.net
Thu, 28 Apr 2005 20:26:33 +0200


Jens Axel Søgaard wrote:

> Since             p + nq
>        n + p/q = ---------
>                      q
> 
> wouldn't
> 
>       val (op +) =
>          fn (T(n,1), T(p,q)) => T(p+n*q, q)
>           | (x,y) => let val (p,p',l) = scale(x,y)
>                          in T(p + p',l)
>                      end
> 
> be an improvement?

Make that

        val (op +) =
           fn (T(n,one), T(p,q)) => T(p+n*q, q)
            | (x,y) => let val (p,p',l) = scale(x,y)
                           in T(p + p',l)
                       end

-- 
Jens Axel Søgaard