:s -u <CR> (<) 2

Mark P Jones mpj@cse.ogi.edu
Mon, 22 Apr 2002 11:56:37 -0700


| Subject line says it all, just about:
| 
| in hugs/winhugs98 (haskell98 mode), challenge the interpreter with the
| following 8 characters (not including blanks):
|
| Prelude> :s -u
| Prelude> (<) 2
|
| and the result is not pretty...nor very useful.  It has to be interrupted
| manually.
| ...
| Am I right or?  And is there a prize for the shortest bug ?

This isn't a bug.  When you use -u, you're asking Hugs to show
you its internal structures as best as it can, without trying
to make use of any show functions.  In this case, your partial
application involves a dictionary for Ord (i.e., a collection
of functions that implement the operations of the Ord class),
and that structure is infinite (in fact it's cyclic, a consequence
of the reliance on default definitions for members of Ord that
aren't spelled out explicitly).  And of course it takes rather
a lot of time and characters to print out an infinite structure ...

My advice, if you don't want to look under the hood, don't use :set -u

All the best,
Mark