[GHC] #15226: GHC doesn't know that seq# produces something in WHNF
GHC
ghc-devs at haskell.org
Wed Jul 18 17:24:05 UTC 2018
#15226: GHC doesn't know that seq# produces something in WHNF
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Runtime | Test Case:
performance bug | perf/should_run/T15226, 15226a
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4796
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by dfeuer):
Replying to [comment:16 simonpj]:
> > seq# is intentionally lazy in its argument, to allow explicit ordering
in an IO context
>
> Hmnm. Can you give an example? Nothing in `seq#`'s documentation says
that. It jolly well should!
Considering `seq#` strict can be rather bad, I believe. If we turn `....
seq# x s` into `case x of x' {DEFAULT__ -> .... seq# x' s}` then we'll see
that `x'` is evaluated and erase the `seq#`. That sort of thing is the
very sort of trouble `seq#` was intended to avoid.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15226#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list