
9 Apr
2012
9 Apr
'12
11:57 a.m.
Hi, Can't seem to be able to debug the following: import System.IO nHead :: Int -> String -> String nHead n str = if (length str) < n then str else if n ==0 then str else (\x n str -> if n == 0 -- this lambda does not work then str else x (n - 1) (tail str)) main = interact (nHead 5) I see where the problem is. But surely it is possible to make a recursive lambda. (I want to use a lambda, i know how to do otherwise) -- Sarfraz K.