Skip to content
Snippets Groups Projects
Commit 33aaa8a6 authored by sven.panne@aedion.de's avatar sven.panne@aedion.de
Browse files

[project @ 2000-05-28 20:45:45 by panne]

Rewrote RULES for gcd and lcm without forall. The old versions *did
not* always fire because of a strange interaction with automatically
generated specialisations for gcd! Example for this misbehaviour:

   main :: IO ()
   main = do
      print (gcd             15675            156750 :: Integer)
      print (gcd 12345678987651075            156750 :: Integer)
      print (gcd            156750 12345678987651075 :: Integer)
      print (gcd  2469135797530215 12345678987651075 :: Integer)

I don't understand why the new version works and the old one did not,
so somebody else should probably have a look at this phenomenon.

*please merge* (like all my commits in the last few days :-}
parent dd6234cc
No related branches found
No related tags found
No related merge requests found
......@@ -306,8 +306,8 @@ lcm x y = abs ((x `quot` (gcd x y)) * y)
{-# RULES
"Int.gcd" forall a b . gcd a b = gcdInt a b
"Integer.gcd" forall a b . gcd a b = gcdInteger a b
"Integer.lcm" forall a b . lcm a b = lcmInteger a b
"gcd/Int->Int->Int" gcd = gcdInt
"gcd/Integer->Integer->Integer" gcd = gcdInteger
"lcm/Integer->Integer->Integer" lcm = lcmInteger
#-}
\end{code}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment