
7 Dec
2007
7 Dec
'07
8:46 a.m.
On Dec 7, 2007 6:27 AM, Victor Nazarov
Cool solution and not so complicated and ad-hoc. But I'd like to ask isn't the following definition is more natural and simple?
nary 0 x [] = x nary n f (x:xs) | n > 0 = nary (n-1) (f $ read x) xs
Sometimes it helps to write type signatures for functions. As in this case, where you'll find you won't be able to... :-) Luke