IxpertaSolutions / freer-effects

An implementation of "Freer Monads, More Extensible Effects".
BSD 3-Clause "New" or "Revised" License
65 stars 12 forks source link

Add handler functions for dealing with Writers and Trace interactively #44

Open axman6 opened 7 years ago

axman6 commented 7 years ago

One of the common uses for Writer is to provide pure logging. Sometimes it is useful to be able to get these logging values as they occur during interpretation. I've added functions for interpreting Writer and Trace in terms of another effect, such as IO, allowing Writer to be used for logging, using different logging levels and handle each level differently (a use case that has come up at work where we want to add tracing info but ignore it unless debugging).

xkollar commented 7 years ago

Hi @axman6. Would pr #30 solve the part with the Trace effect?

axman6 commented 7 years ago

@xkollar looks perfect to me!

xkollar commented 7 years ago

@axman6: thanks for having a look. I'll try harder to get it into a master :-).