所以我有类似的东西:
[IO Blah, IO Blah, IO Blah]
我真的只想要
Blah
的列表s,我该怎么办?P.S.:是的,我在一个 IO 函数中工作。
最佳答案
使用 sequence
.
Evaluate each action in the sequence from left to right, and collect the results.
do blahs <- sequence listOfIoBlah
-- now use blahs
关于haskell - 从 IO 操作列表中提取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9831291/