fused-effects / fused-effects-system

Profiling for Haskell programs without recompiling, via fused-effects.
5 stars 0 forks source link

Explore relationships with logging & more general tracing #8

Open robrix opened 4 years ago

robrix commented 4 years ago

@dcreager observed to me the other day that profiling & logging are both instances of tracing. measure has something of this character; we explicitly delimit a block of some significance, which significance is currently defined entirely in terms of the measurements we may take.

But the same deliberately laid-out structure (beyond the actual call stack, which is an implementation detail) is relevant to logging (cf structured logging, observability) as well, for exactly the reason Doug pointed out: it’s a delineation in how you choose to organize your program’s execution.

This suggests decoupling this structure from the Profile effect & instead defining profiling as (approximately) a (structure-enriched) Writer of labelled measurements. Then carriers for a hypothetical logging effect could likewise take advantage of this information.