[Haskell-cafe] A first glimps on the {-# NOUPDATE #-} pragma

Joachim Breitner breitner at kit.edu
Wed Aug 29 10:20:21 CEST 2012


Am Dienstag, den 28.08.2012, 18:16 -0400 schrieb Carter Schonwald:
> On Tuesday, August 28, 2012, Yves Parès wrote:
>         Monad? Simple strictness anotation is enough in that case:
>                 upd_noupd n =
>                     let l = myenum' 0 n
>                         h = head l
>                     in h `seq` last l + h

darn, I though I changed my examples before posting to:

        upd_noupd n = 
            let l = myenum' 0 n
            in last l + length l

("head" was a bad example because actually due to strictness analysis
and worker/wrapper transformation, GHC would yield good code even
without "`seq`").

In this case (which is actually the benchmarked case), reordering or
strictness annotations do not help.

Greetings and sorry for the confusion,

Dipl.-Math. Dipl.-Inform. Joachim Breitner
Wissenschaftlicher Mitarbeiter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120829/dce876a3/attachment.pgp>

More information about the Haskell-Cafe mailing list