| This is the main wibble people forget when writing rules -- inlining.
| In your example, 'gen' is so cheap, it is immediately
| inlined, so it won't be available to match on in your rule.
I'll add a note in the user manual about this.
In general, GHC tries RULES before inlining. In this parti
thanks,
it works fine now.
2008/5/27 Don Stewart <[EMAIL PROTECTED]>:
> jakubuv:
>> Thanks lot, it works now. Now, I have just a simple question:
>>
>> Is there any chance to make rewriting working in ghci ?
>
> I think you can actually enable them by putting:
>
> {-# OPTIONS -frewrite-rules #-}
jakubuv:
> Thanks lot, it works now. Now, I have just a simple question:
>
> Is there any chance to make rewriting working in ghci ?
I think you can actually enable them by putting:
{-# OPTIONS -frewrite-rules #-}
at the top of the file to be interpreted. Works for me, anyway.
-- Don
_
Thanks lot, it works now. Now, I have just a simple question:
Is there any chance to make rewriting working in ghci ?
jan.
2008/5/27 Don Stewart <[EMAIL PROTECTED]>:
> jakubuv:
>> Hi,
>>
>> I'm trying to find out how the GHC rewrite rules pragma work, but I'm
>> not able to make it working. I ha
jakubuv:
> Hi,
>
> I'm trying to find out how the GHC rewrite rules pragma work, but I'm
> not able to make it working. I have this simple example, where I would
> like to specialize the function gen to spec on strings:
>
> {-# OPTIONS -O2 -fglasgow-exts #-}
>
> gen :: [a] -> a
> gen = head
>
>