Skip to content

Basic question about writing effects in terms of other effects #177

Answered by arybczak
sullyj3 asked this question in Q&A
Discussion options

You must be logged in to vote

My question is, must the "higher level" effect always be dynamically dispatched?

Yes. If you want to depend on an existing effect, it has to be dynamically dispatched. Static effects are primitive in a sense as they can't use other effects.

But considering that the FileSystem effect itself is static and just a thin wrapper for stuff from base/bytestring, you can just make hello use hPutStrLn (or writeFile) directly.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sullyj3
Comment options

Answer selected by sullyj3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants