Using DeepSeq for exception ordering

Simon Hengel sol at typeful.net
Mon Nov 12 17:56:19 CET 2012


> Did you try -fpedantic-bottoms?

I just tried.  The exception (or seq?) is still optimized away.

Here is what I tried:

    -- file Foo.hs
    import Control.Exception
    import Control.DeepSeq
    main = evaluate (('a' : undefined) `deepseq` return () :: IO ())

    $ ghc -fforce-recomp -fpedantic-bottoms -O Foo.hs && ./Foo && echo bar
    [1 of 1] Compiling Main             ( Foo.hs, Foo.o )
    Linking Foo ...
    bar

Cheers,
Simon



More information about the Glasgow-haskell-users mailing list