On Dec 7, 2007 2:52 PM, <[EMAIL PROTECTED]> wrote: > > In fact, that distinction is possible. The following article > > How to write an instance for not-a-function > http://okmij.org/ftp/Haskell/typecast.html#is-function-type > > specifically describes a method of writing an instance which is > selected only when the type in question is NOT a function. The method > is quite general and has been extensively used (for example, to > implement deep monadic join). >
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 -- vir http://vir.comtv.ru/ _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
