[Haskell-cafe] Observations from ListLike

John Goerzen jgoerzen at complete.org
Mon Sep 17 15:37:11 EDT 2007

Hi folks,

I just announced ListLike[1] on haskell at haskell.org.  Rather than repeat
that announcement here, I'd like to make a few observations that came
out of the development of this program:

* I wrote extensive QuickCheck cases for this and wrapped them in HUnit
  for better display and future extensibility.  Two bugs in the GHC
  base libraries were discovered as a result (one has been fixed
  already in HEAD, one not)

* Hugs programs that use cpphs can't use ByteString

* It would be really nice if QuickCheck supported I/O and some version
  of HUnit's TestLabel to generate hierarchical names when failures

* It would also be much nicer if QuickCheck defined Arbitrary instances
  for Word8 and Char.  On Hugs, QuickCheck also lacks an instance of
  Maybe, but GHC has it for some reason.

* Testing functions like foldl in Hugs, where QuickCheck is supplying
  the list and the function, cause Hugs to crash with stack errors.
  Testing some functions over ByteStrings cause Hugs to crash
  complaining of being out of ForeignPtrs.  I have yet to figure out how
  to fix either problem; raising the heap size doesn't help.

* I had some cases in String.hs[2] where Hugs did not permit me to 
  define the default functions within the class declaration.  However,
  I could define the functions outside, with the exact same type
  signature as they'd have inside, and within the class declaration,
  just say something like "words = myWords" to refer to the external
  declaration.  GHC worked fine both ways.

It seems that Hugs has a number of issues with code like ListLike that
uses some more advanced Haskell features, even though Hugs nominally
supports them.  If you look through my Mercurial changelogs, you'll see
"fix blah for hugs" messages all over.  Which is too bad, because Hugs
seems more portable (especially to embedded devices) than GHC.

[1] http://software.complete.org/listlike
[2] http://software.complete.org/listlike/browser/src/Data/ListLike/String.hs

More information about the Haskell-Cafe mailing list