Changes between Version 3 and Version 4 of Demand/IO-vs-ST


Ignore:
Timestamp:
Mar 27, 2017 10:38:24 PM (3 years ago)
Author:
dfeuer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Demand/IO-vs-ST

    v3 v4  
    2626effects. Has anyone checked?). One option would be to actually add a `FakeWorld`
    2727type and a `fakeWorld#` primitive to use it. This option is explored
    28 in phab:D3375. One surprising point: the `case` on
     28in phab:D3375. One surprising point: the `case` on the result needs to be moved
     29inside the `runFW#` argument. That is, unlike
     30
     31{{{#!hs
     32unsafePerformIO (IO m) = case runRW# m of (# _, a #) -> a
     33}}}
     34
     35we need
     36
     37{{{#!hs
     38runST (ST m) = runFW# (\s -> case m s of (# _, a #) -> a)
     39}}}
     40
     41This allows demand analysis to see that we actually use the second component.
     42It seems that the demand signature we give to `runRW#` is insufficient for that.
    2943
    3044Another possible option Simon hinted at would be to give `runFW#` a