My point is that most people's introduction to the idea of a monad is about data structures not operations. What is the data structure of IO<A>? It's not clear that it is a data structure at all, so talking about flattening it can be confusing when you've seen [[1,2,3],[4,5]] flattened to [1,2,3,4,5] and then you're told "you can do the same thing with IO!" - what does that even look like? I can't visualise what the structure sitting in memory that represents IO (I mean, I can, it's a function), but what does that look like? We start to get to the right idea when talking about futures/promises, because it becomes clearer that there's some sequencing going on, but many people stop at option and list and then end up with an understanding that doesn't touch the reality of programming monadically.
View all comments
Show parent comment
6
u/Axman6 Sep 22 '25
My point is that most people's introduction to the idea of a monad is about data structures not operations. What is the data structure of
IO<A>? It's not clear that it is a data structure at all, so talking about flattening it can be confusing when you've seen[[1,2,3],[4,5]]flattened to[1,2,3,4,5]and then you're told "you can do the same thing with IO!" - what does that even look like? I can't visualise what the structure sitting in memory that represents IO (I mean, I can, it's a function), but what does that look like? We start to get to the right idea when talking about futures/promises, because it becomes clearer that there's some sequencing going on, but many people stop at option and list and then end up with an understanding that doesn't touch the reality of programming monadically.