[Haskell-cafe] I need a hint in list processing
fernanbolando at mailc.net
Mon Jun 15 07:02:33 EDT 2009
On Sun, Jun 14, 2009 at 4:51 PM, Miguel Mitrofanov<miguelimo38 at yandex.ru> wrote:
> ghci> map reverse $ foldM (\answer list -> [x:answer | x <- list, not $ x
> `elem` answer])  [[2,3], [1,2], [2,3,4], [1,2,3]]
> On 14 Jun 2009, at 12:06, Fernan Bolando wrote:
>> Hi all
>> If I have a number of list
>> list1 = [2,3]
>> list2 = [1,2]
>> list3 = [2,3,4]
>> list4 = [1,2,3]
>> I want to create a list from the list above with n elements,
>> non-repeating and each elements index represents 1 of the elements
>> from the corresponding list so for the above input I would get.
>> a = [3,2,4,1]
>> ofcourse there may be several set that will satisfy the problem, so a
>> list of list that satisfies would be good.
>> How do I do this in haskell? or is there a code snippet that seems to
>> work similarly?
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
this is the one that I needed.
thanks also to everyone
More information about the Haskell-Cafe