./T and ./T >& log

Serge D. Mechveliani mechvel at botik.ru
Fri Feb 20 04:38:45 EST 2009


People,
I observe the output difference in running  ./Bug
and                                         ./Bug >& log
(under Linux) for the program 

  import Dumatel
  main = do calcInput <- readFile "List0.inp"
            (putStr $ parseComputeShow calcInput)
    where
    parseComputeShow calcInput =  concat ["t =  ",   showsn 3 t "\n",
                                          "tR =  ",  showsn 3 tR "\n"]
      where
      calc = addInput_default nilParseOpts (bool rpos) calcInput
      t    = parse_default calc "parsing Term"  "(a:nil) + (b:nil)"
      tR   = evaluate emptyUMRMemo AllRules calc t

-- I think, it can be reduced to much simpler one.
The error break has to occur while computing  tR.
The difference is in printing or skipping of the result part before tR.
The first command outputs 

  ---------------------------------
    t =  ((a : nil) + (b : nil))
  Bug:
  substitute {(X, a), (Xs, nil), (Ys, (b : nil))} X:
  sort mismatch in substitution
  ---------------------------------

And the second command skips (in  ./log) the line of   t = ...
Who can tell what is the matter?
How to have identic outputs in this example?

Thank you in advance for explanation.

-----------------
Serge Mechveliani
mechvel at botik.ru





More information about the Glasgow-haskell-users mailing list