iu-parfunc / lvars

The LVish Haskell library
http://hackage.haskell.org/package/lvish
80 stars 14 forks source link

Refactor ParThreadsafe to use secret-superclass #111

Closed rrnewton closed 9 years ago

rrnewton commented 9 years ago

"Secret superclass" is a better design pattern than this current business of using an unsafeParIO method, which we make sure the user cannot instance themselves.

Should be real easy to solve this because unsafeParIO uses can just be replaced with internalLiftIO. And it removes the confusing redundancy between those two.

osa1 commented 9 years ago

Hm, I'm confused about how this is supposed to work. If we define 'ParThreadSafeSecretin a non-exported module inpar-classeswe can't implementParThreadSafeat all, becausepar-classesdoesn't implement any instances. If we exportParThreadSafeSecretinpar-classes`, then users can implement instances.

rrnewton commented 9 years ago

The distinction is between Control.Par.Class (SafeHaskell Trustworthy), and Control.Par.Class.Unsafe (SafeHaskell Unsafe).

The user can get to everything with the unsafe module, but they lose SafeHaskell Safe (inferred) status.