fused-effects
fused-effects copied to clipboard
Add examples of carrier composition
In 0.3, carrier composition is simpler, faster, and more convenient than in earlier versions. We should add at least one example of defining a carrier by composing other carriers together.
This is closely related to but (IMO) distinct from #9, which is about the simpler case of defining a carrier using a single underlying carrier; e.g. FreshC being defined using StateC.
Bumped to 0.3.0.1; 0.3 is ready to go and this needn’t delay it.
I'd be happy to provide an example of this, do you have one in mind?
@mitchellwrosen: Oh, thank you! Nothing off the top of my head; but e.g. I’ve written typechecking effects with a ReaderC for the context + WriterC to collect constraints. I think the example could just show off the mechanical parts of that, tho we should probably also (separately) document why you might abstract underlying effects behind some other effect.
I guess one classic example might be implementing State behaviour using the composition of ReaderC & WriterC.