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

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

> In the ghc manual I read :
> "How do I find out a function's strictness?"
> Don't guess-look it up.
> 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).
> --
> 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.
> 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.