strict bits of datatypes

Ross Paterson ross at soi.city.ac.uk
Fri Mar 16 14:10:20 EDT 2007


On Fri, Mar 16, 2007 at 05:40:17PM +0100, apfelmus at quantentunnel.de wrote:
> The translation
> 
> >     q = FinCons 3 q
> > === (by Haskell 98 report 4.2.1/Strictness Flags/Translation
> >     q = (FinCons $ 3) $! q
> 
> is rather subtle: the first FinCons is a strict constructor whereas the
> second is "the real constructor". In other words, the translation loops
> as we could (should?) apply
> 
>     FinCons
>  => \x y -> FinCons x $! y
>  => \x y -> (\x' y' -> FinCons x' $! y') x $! y
>  => ...
> 
> ad infinitum.

Yes, perhaps that ought to be fixed.  But even so, this clearly implies that

	FinCons 3 _|_ = _|_

and thus that q is _|_ and nhc98/yhc have a bug.



More information about the Haskell-prime mailing list