1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
{-# OPTIONS -XRecursiveDo #-} -- test let bindings module Main (main) where import Control.Monad.Fix t :: IO Int t = mdo x <- return (l "1") let l [] = 0 l (x:xs) = 1 + l xs return x main :: IO () main = t >>= print