Earlier quoted context omitted.
Apologies. I was on the phone typing the above. Still, remarks like "What?" that provide no information or context are against the rules on HN. Just FYI. The OP said that there's no point in labeling an arbitrary type as a functor or monadic value. I'm going to use an example to illustrate how there is a benefit in being aware of this concept. I will be using a "String Monad" in my example. Imagine you have some type…
I would simply do: original_dict = {1:2 ,3:4, 5:6, 7:8} array = sum(map(list, original_dict.items()), []) And it would have been simpler if items returned lists instead of tuples. In my benchmarks it runs 10x faster.
[x for kv in d.items() for x in kv]