|
|
|
|
|
by javbit
1998 days ago
|
|
Would withFADR' :: (FragileAndDangerousResource #-> IO ()) -> IO ()
be a better type? My reasoning is if I use the linear identity function lid :: forall a. a #-> a
in the following withFADR lid
I should be able to “break out of” the managed context [1] by the types. Using withFADR'' :: (FragileAndDangerousResource #-> ()) -> ()
is obviously not right since nothing could be done with the `FragileAndDangerousResource`, so I think side effects are necessary.--- [1]: I'm assuming that's what you're going for with `withFADR`. |
|