rmonad icon indicating copy to clipboard operation
rmonad copied to clipboard

Missing connections

Open arendsee opened this issue 6 years ago • 1 comments

Binding a nested Rmonad into a funnel loses the nested nodes:

1 %>>% { . %>>% { . + 2 }} %>>% funnel(44) %>% size
#R> 4
1 %>>% { . %>>% { . + 2 }} %>% funnel(44) %*>% sum %>% size
#R> 6

The output value is still correct, just history is lost. The problem can be worked around by just using non-monadic piping (e.g. magrittr's %>%) instead of %>>%. But still, the nested graph should not be lost.

arendsee avatar Nov 09 '17 20:11 arendsee

funnel is working on the monad, not in the monad. So the %>>% operator should probably not be used (except in exotic cases). I could add a warning if the user tries to use funnel in this way.

arendsee avatar Jan 02 '18 06:01 arendsee