Kwanghoon Choi wrote:
>
> On Sun, 30 Jul 2000, Peter Roozemaal wrote:
>
[...]
> >
> > Definition:
> >
> > unlist [x] = x
> >
> > >From the interpreter prompt call:
> >
> > unlist [1..3]
> >
> > results: ``endless'' scrolling error message, ending with:
> >
> > [...]
> > (Make.Ord instEq_v30 primCmpInteger (Ord_default_compare (Make.Ord
> > instEq_v30 primCmpInteger (Ord_default_compare (Make.Ord instEq_v30
> > ERROR: Garbage collection fails to reclaim sufficient space
> >
[...]
> Hello,
>
> It is not certain that I understand your problem thoroughly because
> it is not clear for me how your codelet is related to type class.
> (I may be totally wrong ^^;) However, if the error message is related
> to type class (as the error message implies), an old article that I keep
> may be helpful. The article was sent to the hugs-bugs mailing list
> by Mark Jones. I enclose his article below, though you may also find
> it in some mail archives.
>
> Kwanghoon
>
[...]
I think it's got something to do with the way ranges are implemented
(lazy
evaluation) and the error message print routine forcing some thunks to
be
evaluated. Giving the unlist function an infinite list gives a finite
error
message:
Main> unlist [1..]
Program error: {unlist [1,2] ++ (numericEnumFrom instReal_v37 $!
(Real_sc0.Real instReal_v37 Num_+ 2) (Num_fromInt (Real_sc0.Real
instReal_v37) 1))}
Does this give some more insight?
Greetings, PeteR