3 ms·
Can you show me how to convert the example I showed, using the yield-based notation? I did try but I couldn't get it to do much, not even what I thought it shou
by jerf 16y ago
Can you show me how to convert the example I showed, using the yield-based notation? I did try but I couldn't get it to do much, not even what I thought it should. (I did add the unit for list.)
print List([1, 2, 3]) >>
(lambda a: List([4, 5, 6]) >>
lambda b: List([(a, b)])))
does work as I expect, but I was thinking about the yield syntax when I said it doesn't work. If you can provide it I will stand corrected.
- jmillikin 16y agoOh, I didn't look much at the yield-based stuff -- I think it looks worse than the lambdas, since it depends on magic exceptions and can't be used to write procedures which work for any monad. If it doesn't work, I'm not surprised.