[Haskell-cafe] how to write a function to send a string to a tuple

Pradeep Wickramanayake pradeep at talk.lk
Mon Mar 8 08:02:49 EST 2010


Hi,

 

Im having problems with sending a string to a tuple. 

 

My string contains integers and strings

 

The whole string stay as ("test,dfdf",3,"dfsf")

 

sortList2 :: String -> String

sortList2 (x:xs) 

                | x == ',' = ""

                | otherwise = [x] ++ sortList2 xs

 

The above function separating each words from the string

 

Now I need to put them to a tuple

 

putList :: String -> (Int, String, String, Int, Int)

putList (x:xs)

                                                |xs /="" = sortList2 ++
putList xs

 

 

I wrote something like above. But I really have no clue how to continue. Can
someone help me. It's a big help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100308/094945f0/attachment.html


More information about the Haskell-Cafe mailing list