fork download
  1. import System.IO.Unsafe
  2.  
  3. main = print (faktorial 5)
  4.  
  5. faktorial n | n==0 = 1
  6. | True = seq (printBezIO $ "vichisljaem faktorial! " ++ show n)
  7. (n*faktorial (n-1))
  8.  
  9. printBezIO = unsafePerformIO . print
Success #stdin #stdout 0s 4600KB
stdin
Standard input is empty
stdout
"vichisljaem faktorial! 5"
"vichisljaem faktorial! 4"
"vichisljaem faktorial! 3"
"vichisljaem faktorial! 2"
"vichisljaem faktorial! 1"
120