简体   繁体   中英

How do I transform [IO X] into IO [X]

I have some data type X and a function which returns IO [X] but my computation is currently returning [IO X]. What is a general method for transforming [IO X] into IO [X]?

Use sequence .

Eg

> sequence [return 1, return 2]
[1,2]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM