定义.Functor 是范畴论的一个术语, 在这里我们可以简单将其理解为"实现了map函数"的interface.进一步地, Parser 同样符合"串行运算"的特质, 为了简洁, 我们这里只给出其类型定义...f (t a)fromStruct和fromArray一样, 其实现最终导向了这个"奇怪"的类型转换, 接下来我们就深入这个类型签名, 讲讲其背后蕴含的理论.sequenceA和Applicative我们再来看这个类型签名...实现.Functor上文提到过, 让我们简单看看Monad.interface Monad extends Applicative{ chain: (fa: F, f: (...和Monad.chain:then(f: (a:A) => B): Promise 对应Functor.mapthen(f: (a:A) => Promise): Promise...的类型声明中, Monad还实现了Applicative:interface Applicative extends Functor { of: (a: A) => F;