Dominic J Steinitz [EMAIL PROTECTED] writes:
> 
> Can anyone tell me why this behaves as it does? In Hugs, I get 
> 
> C:\My Documents\functional\ldapsck1\buffer.hs
> Main> main
> 
> Illegal operation
> (561 reductions, 1029 cells)
> 
  ..program elided...
> 

The reason for the behaviour you're seeing is that Hugs doesn't report
you reading past the end of the file as an EOF error (Hugs never
reports EOF errors, but maps them to illegal ops instead). So, to have
it work with both Hugs and GHC, you need to change the 'Left' branch
of the case expression in 'main' from

  Left e ->
     if isEOFError e 
                             then do ....
                             else do ...

to

  Left e ->
     if isEOFError e || isIllegalOperation e
                             then do ....
                             else do ...


hth
--sigbjorn



_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs
  • IO Errors Steinitz, Dominic J
    • Sigbjorn Finne

Reply via email to