Replies: 2 comments 2 replies
-
One option you have is to forget about module M where
onlyCreateDirectory :: (FilePath -> Eff es ()) -> Eff es ()
onlyCreateDirectory createDirectory = ...
module N where
import M qualified
import Effectful.FileSystem
controller :: FileSystem :> es => Eff es ()
controller = M.onlyCreateDirectory createDirectory |
Beta Was this translation helpful? Give feedback.
1 reply
-
what would be the problem in creating a separate effect and using an existing effect in its handler with reinterpret? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it idiomatic to want to narrow down the possible actions in an effect? In my specific case, I'd like to expose a
FileSystem
effect that only allowscreateDirectory
calls. I can write the effect entirely myself, or I can arrange this with re-exports of Effectful.FileSystem, but I have a few questions:FileSystem
effect in the example from Effectful.Dispatch.Dynamic. I might want to expose a read-only version of this effect; how should I do that?Beta Was this translation helpful? Give feedback.
All reactions