
22 Jun
2010
22 Jun
'10
2:32 a.m.
Hi, I'd like to learn how to use ghc rewrite rules. I simply want to replace a function called f by a function called g. I do not unterstand why the rule f->g does not fire. Cheers, Jan module Main where {-# RULES "f->g" forall x. f x = g x #-} main :: IO () main = print (f 1) {-# NOINLINE f #-} f :: a -> Bool f _ = False g :: a -> Bool g _ = True