为什么“同时"在Haskell中不是单子?
问题描述:
I'm reading the doc of package async, and trying to find something similar to JavaScript's Promise, and I find Concurrently
, which is the most close concept that implemented Functor
, Applicative
(Promise.all), Alternative
(Promise.race). But it doesn't implement Monad
(Promise.then), I'm wondering why.
我认为可能是因为(>>=)
是顺序操作,与名称Concurrently
冲突,但这是唯一的原因吗?这里还有一些更重要的原因吗?
I think it maybe because (>>=)
is a sequential operation, which conflict with the name Concurrently
, but is this the only reason? is there some more important reason here?