agrafix / superrecord

Haskell: Supercharged anonymous records
BSD 3-Clause "New" or "Revised" License
83 stars 16 forks source link

Use runST and ST instead of IO and unsafePerformIO #15

Closed axman6 closed 6 years ago

axman6 commented 6 years ago

It appears all of the functions used to create and modify all the Small(Mutable)Array#'s also work in the ST monad, which would mean it should be possible to replace all

unsafePerformIO $! IO $ \s -> ...

with

runST $! ST $ \s -> ...

and hopefully proceed exactly the same code while avoid the unnecessarily using the unutterable function.

agrafix commented 6 years ago

Should work! Feel free to send a PR :)

reactormonk commented 6 years ago

Fixed by https://github.com/agrafix/superrecord/pull/16