rmonad
rmonad copied to clipboard
Missing connections
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.
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.