
hi, can anyone help me sorting elements of a list ["ala", "zero", "jera"] in alphabetical order

You want the number-strings to stay in the list? Can you show what that list
would look like sorted?
Tom/amindfv
On Oct 7, 2011 10:18 PM, "kolli kolli"
what if i have ["ala", "0020", "zero", "00021" , "jera","0030"] and I want to sort only the words and nt the numbers
On Fri, Oct 7, 2011 at 8:53 PM, Felipe Almeida Lessa < felipe.lessa@gmail.com> wrote:
import Data.List
s = sort ["ala", "zero", "jera"]
- Felipe.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

i want the o/p to be ["ala", "jera","zero", "0020", "0030","0022"]
On Fri, Oct 7, 2011 at 9:45 PM, Tom Murphy
You want the number-strings to stay in the list? Can you show what that list would look like sorted?
Tom/amindfv On Oct 7, 2011 10:18 PM, "kolli kolli"
wrote: what if i have ["ala", "0020", "zero", "00021" , "jera","0030"] and I want to sort only the words and nt the numbers
On Fri, Oct 7, 2011 at 8:53 PM, Felipe Almeida Lessa < felipe.lessa@gmail.com> wrote:
import Data.List
s = sort ["ala", "zero", "jera"]
- Felipe.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Use the sortBy function to supply your own comparison function.
On Fri, Oct 7, 2011 at 11:51 PM, kolli kolli
i want the o/p to be ["ala", "jera","zero", "0020", "0030","0022"]
On Fri, Oct 7, 2011 at 9:45 PM, Tom Murphy
wrote: You want the number-strings to stay in the list? Can you show what that list would look like sorted?
Tom/amindfv
On Oct 7, 2011 10:18 PM, "kolli kolli"
wrote: what if i have ["ala", "0020", "zero", "00021" , "jera","0030"] and I want to sort only the words and nt the numbers
On Fri, Oct 7, 2011 at 8:53 PM, Felipe Almeida Lessa
wrote: import Data.List
s = sort ["ala", "zero", "jera"]
- Felipe.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (4)
-
David McBride
-
Felipe Almeida Lessa
-
kolli kolli
-
Tom Murphy