blob: eee0be98ea4cc4ff49049609ba7451e19e501ce6 (
plain)
1
2
3
4
5
6
7
8
9
10
|
{-# LANGUAGE RecursiveDo #-}
-- check that mdo does perform segmentation
t :: IO [Int]
t = mdo xs <- return (1:xs)
print (length (take 10 xs)) -- would diverge without segmentation
return (take 10 xs)
main :: IO ()
main = t >>= print
|