The Purpose of Layer.discard/EffectDiscard/ScopedDiscard in Creating Layers
im curious about the point of
why even make a
consider
http does things in layers:
but I dont see why this couldnt just be an Effect?
with cli:
Layer.discard/Layer.effectDiscard/Layer.scopedDiscardwhy even make a
Layer if it doesnt produce anything? Why not just make it an Effect?consider
@effect/platform's Http.server.serve vs @effect/cli's Command.runhttp does things in layers:
but I dont see why this couldnt just be an Effect?
with cli:
run could totally be a Layer<CommandLineArgs | CLI.Enviorment, ValidationError, void, but its just a function that returns an effect