coeffects
Coeffects are a concept in programming language theory that describe the contextual requirements a computation draws from its execution environment. While effects describe how a computation may alter the outside world, coeffects describe what the computation needs from its context to run. Examples include access to a clock, a configuration parameter, or an input stream. Coeffect systems extend type systems by annotating functions with their contextual dependencies, enabling safer composition and reasoning about where code can run and which resources it depends on.
Historically, coeffects have been studied as a formal counterpart to effect systems. They can be modeled using
Examples of coeffectful computations include a function that reads the current time (requiring a clock), one
Applications of coeffect systems include safer resource management, modular programming across components with different capabilities, and