monads

Is Python's "with" monadic?

Is Python's "with" monadic? Question: Like many a foolhardy pioneer before me, I’m endeavoring to cross the trackless wasteland that is Understanding Monads. I’m still staggering through, but I can’t help noticing a certain monad-like quality about Python’s with statement. Consider this fragment: with open(input_filename, ‘r’) as f: for line in f: process(line) Consider the …

Total answers: 4