我是Haskell的新手并且正在玩一些code。 我对以下GHCI会议感到困惑:
*Main> :l golden_cross_sample.hs
*Main> :t stateProcessors
stateProcessors :: [State GoldenCrossState String]
*Main> :t sequence
sequence :: Monad m => [m a] -> m [a]
*Main> let res1 = (sequence stateProcessors)
*Main> :t res1
res1 :: StateT GoldenCrossState Identity [String]
从sequence
的类型签名中,我希望res1
具有类型State GoldenCrossState [String]
。为什么不呢?