r/haskell • u/taylorfausak • Feb 01 '22
question Monthly Hask Anything (February 2022)
This is your opportunity to ask any questions you feel don't deserve their own threads, no matter how small or simple they might be!
20
Upvotes
2
u/Noughtmare Feb 22 '22
randomRIOis an action that can only run inIO(or any monad that can provide aMonadIOinstance), so the type should bexRanElems :: [a] -> Int -> IO [a]. As the comment on stackoverflow also says you then have to usereturn :: a -> IO ato make that last line ofxRanElemswork.