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

Francis Girard francis.girard@free.fr
Wed, 18 Jun 2003 05:32:36 +0200


Hi,

Thank you all for your answers.

I recompiled with -O option and now I can see the strictness analysis in the 
interface files.

Notice however that if I compile with the "-prof -auto-all -O" flags then I 
got the following error message when I try to examine the interface file 
(with --show-iface) :

mismatched interface file versions: expected 5043, found 5043p

Thank you

Francis Girard
francis.girard@free.fr
LE CONQUET, France

Le 17 Juin 2003 13:00, Simon Marlow a écrit :
> > 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
> > third field in the
> > pragma; it should say __S <string>. The <string> gives the
> > strictness of the
> > function's arguments. L is lazy (bad), S and E are strict
> > (good), P is
> > "primitive" (good), U(...) is strict and "unpackable" (very
> > good), and A is
> > absent (very good).
> >
> > --
> >
> > When I look in the *.hi binary files generated by ghc with
> > ghc --show-iface, I
> > 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.
>
> Cheers,
> 	Simon
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users