Haskell.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

-O2

Saswat Anand

15 Apr 2002 15 Apr '02
4:30 a.m.

Hi, In my program I observe that, with -O2 flag turned on, Program 1 behaves like Program 2. And without O2, their outputs are different. Is it the desirable behaviour? For my program, I did not expect the optimizer to do this transformation. Thanks, Saswat Program 1: eval = \..-> let t = some_long_expression tree q = Tree (w:=q) some_long _expression in if w /= 0 then concatMap (cc con1) [tree x | x <- [1..n]] else t Program 2: eval = \..-> let t = some_long_expression tree q = Tree (w:=q) t -- Here is the difference in if w /= 0 then concatMap (cc con1) [tree x | x <- [1..n]] else t some_long_expression stands for, concatMap (cc con2) $ zipWith join (eval v c1 (reverse v1)) (eval v c2 v2)

0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.9.