"How do I find out a function's strictness?"

Simon Marlow simonmar@microsoft.com
Tue, 17 Jun 2003 12:00:39 +0100


=20
> In the ghc manual I read :
>=20
> "How do I find out a function's strictness?"
> Don't guess-look it up.
>=20
> Look for your function in the interface file, then for the=20
> third field in the=20
> pragma; it should say __S <string>. The <string> gives the=20
> strictness of the=20
> function's arguments. L is lazy (bad), S and E are strict=20
> (good), P is=20
> "primitive" (good), U(...) is strict and "unpackable" (very=20
> good), and A is=20
> absent (very good).
>=20
> --
>=20
> When I look in the *.hi binary files generated by ghc with=20
> ghc --show-iface, I=20
> don't see anything like "__S" anywhere.
>=20
> Where should I look ?

Make sure the module is compiled with -O, otherwise the strictness
analyser isn't run and you don't get any strictness info.

Cheers,
	Simon