[ Home Page | Latest News | Downloading | FAQ | Bugs & Features | Documentation ]

Hugs Bugs & Features

Here is a list of known Hugs bugs. If you find a bug which is not on this list, please report it by sending email to hugs-bugs@haskell.org.

Some bugs may be parts of Haskell 98 that are not yet implemented in Hugs 98. Please consult the Hugs 98 User's Guide before you report differences between the Haskell 98 report and Hugs 98.

 

 Unfixed Bugs / Features

The following "bugs" have been reported, but not been fixed.

  • Depending on the relative sizes of your heap, Hugs stack and C stack, expressions like this
      foldl (\n _ -> n + 1) 0 [1..100000]
    
    can overflow the C stack before exhausting the heap or Hugs stack. On Unix, this usually causes a segmentation fault and causes Hugs to abort.
  • Björn von Sydow (sydow@cs.chalmers.se) reports that this expression runs in constant space
    mapM_ putStr (repeat "")
    
    but this program does not:
    main = mapM_ putStr (repeat "")
    
    This is caused by "CAF-leaks" - a long-standing problem of most Haskell compilers (except HBC?). The problem is that main is being updated with an expression of the form:
    main = putChar ' ' >> putChar ' ' >> putChar ' ' >> mapM_ putStr (repeat "")
    
    In the long term, we hope to avoid this kind of problem by using a smarter garbage collector. In the short term, you can avoid the problem by making the troublesome CAFs non-updateable. For example, you might rewrite main as:
    main _ = putChar ' ' >> putChar ' ' >> putChar ' ' >> mapM_ putStr (repeat "")
    
    and then execute
    main ()
    .
  • A lower-level, more complete list of outstanding bugs can be found here [somewhat out-of-date now; last updated: April 2002.]

 Non Bugs

The following look like bugs but aren't:

  • Rank-2 polymorphism is slightly restricted in comparison with GHC (which actually has rank-n polymorphism). In Hugs, all polymorphic arguments must be supplied. For example, runST must always be applied to an argument. This means that you cannot write:
       myrunST = runST
    However,
       myrunST arg = runST arg
    is fine.
  • When you evaluate an expression in the interpreter, it has to use some symbol table for looking up the ids you use. What symbol table does it use? The only credible alternatives are:
    • The export list of the "current module" (see :module command)
    • The symbol table of the "current module"
    Hugs uses the latter (which seems more useful) but you might reasonably expect Hugs to use the export list and wonder why Hugs doesn't seem to implement abstract data types correctly when you do experiments from the command line.
  • Hugs doesn't implement the restriction stated in the report (section 4.3.1) that the type of member functions may only add constraints to the type variables which are local to the member. Thus Hugs accepts this program without reporting an error:
        module M where
        class C a where f :: Eq a => a
        
 

Last Updated:
Dec 13, 2001

[ Home Page | Latest News | Downloading | FAQ ]
[ Bugs & Features | Documentation ]

Copyright 2001 OGI and Yale
Report problems to <hugs-bugs@haskell.org>