Generalize the type of runRW#
authorDavid Feuer <david.feuer@gmail.com>
Thu, 26 Jan 2017 02:14:54 +0000 (21:14 -0500)
committerDavid Feuer <David.Feuer@gmail.com>
Thu, 26 Jan 2017 02:21:01 +0000 (21:21 -0500)
commitc344005b2344800bee9fee1c5ca97867691b9c70
tree1626f2d3401a1896abd858633b716eb359d3ca48
parent95dc6dc070deac733d4a4a63a93e606a2e772a67
Generalize the type of runRW#

* Generalize the type of `runRW#` to allow arbitrary return types.

* Use `runRW#` to implement `Control.Monad.ST.Lazy.runST` (this
provides evidence that it actually works properly with the generalized
type).

* Adjust the type signature in the definition of `oneShot` to match
the one it is given in `MkId`.

Reviewers: simonmar, austin, bgamari, hvr

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3012

GHC Trac Issues: #13178
compiler/basicTypes/MkId.hs
libraries/base/Control/Monad/ST/Lazy/Imp.hs
libraries/ghc-prim/GHC/Magic.hs