[Haskell-beginners] Again on list manipulations

Lorenzo Isella lorenzo.isella at gmail.com
Fri Sep 10 10:55:43 EDT 2010


Dear All,
I know this must be a one-liner, but it am banging my head against the wall.
I am trying my hands at list manipulation in Haskell and a lot of useful 
function are making my life easier but I cannot achieve something really 
simple.
Let us say you have the lists ml and sel

ml=[23,44,55,8,98]
and
sel=[1,2] .

Now, I would like simply to get a new list whose entries are the 
elements of ml in position sel. In my case things might be a little more 
complicated because all the elements are Integer and not Int (I noticed 
that sometimes this means I have to resort to generic functions).
Cheers

Lorenzo


More information about the Beginners mailing list