3 ms·
i followed (and enjoyed) most of that, but i don't get (perhaps because i've not used haskell in a long time) how the consumer is automatically(?) chosen. from
by andrewcooke 14y ago
i followed (and enjoyed) most of that, but i don't get (perhaps because i've not used haskell in a long time) how the consumer is automatically(?) chosen.
from what i understand of section 3.2 the consumer is critical in selecting the correct stream type from the bundle. who decides that? does the user have to select the appropriate function? or does it some how fall out naturally from the use case? or does the compiler select it?
- mainland 14y agoThe library writer is the "consumer" here. The programmer just uses the library, and the library chooses the proper stream representation. Of course the programmer can also use the lower-level stream interface directly if desired, but then the programmer must also know which stream representation to choose.