Skip to content
  • David Feuer's avatar
    Make unsafeInterleaveST less unsafe · 30d68d63
    David Feuer authored
    * Make `unsafeInterleaveST` use `noDuplicate#` like
    `unsafeInterleaveIO` does to prevent the suspended action from
    being run in two threads.
    
    * In order to accomplish this without `unsafeCoerce#`, generalize
    the type of `noDuplicate#`.
    
    * Add `unsafeDupableInterleaveST` to get the old behavior.
    
    * Document unsafe `ST` functions and clean up some related
    documentation.
    
    Fixes #13457
    
    Reviewers: austin, hvr, bgamari, ekmett
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3370
    30d68d63