[Haskell-cafe] A small puzzle: inTwain as function of foldr

Sebastiaan Visser sfvisser at cs.uu.nl
Thu Jun 4 15:41:49 EDT 2009


On Jun 4, 2009, at 4:32 PM, Sittampalam, Ganesh wrote:
> Martijn van Steenbergen wrote:
>
>> Consider the function inTwain that splits a list of even length
>> evenly into two sublists:
>>
>>> inTwain "Hello world!"
>> ("Hello ","world!")
>>
>> Is it possible to implement inTwain such that the recursion is done
>> by one of the standard list folds?
>
> Does this help? http://www.brics.dk/RS/02/12/BRICS-RS-02-12.pdf
>
> Ganesh

And maybe this helps:

http://www.springerlink.com/content/h1547h551422462u/

--
Sebastiaan Visser





More information about the Haskell-Cafe mailing list