jimjam-slam / collateral

Map, find and isolate captured side effects
https://collateral.jamesgoldie.dev
Other
42 stars 2 forks source link

Helpers for extracting side effects #5

Open jimjam-slam opened 6 years ago

jimjam-slam commented 6 years ago

Extracting the results from a collateral list-column isn't too hard: map(my_safe_column, 'result').

Other side effects are a little trickier, though: the messages from errors are wrapped inside an object along with other text, and there can be several warnings, messages or other outputs for each element. Should collateral provide helpers to quickly provide companion columns with collapsed versions of these?

MatthieuStigler commented 6 years ago

that would be great, and indeed, issue is that warnings might multiple, so that would create a n issue. But maybe still having a function that helps mutate() the 2/4 slots of safely/quietly as columns, or return the output of safely/quietly as data_frame would be already a goof first step? In general, I found that handling the output of safely/quietly to be quite cumbersome!

jimjam-slam commented 6 years ago

I think they're definitely worth including in a prescriptive way! Whatever we settle on, the functions won't actually be super complicated, and people can always write their own alternatives if they'd prefer.