How can I get the indexes of elements in a Haskell list -
is there function in haskell returns indexs of elements elemindex
in list. example list [1,2,3,4,2,3]
, looking 2
returns [1,4]
.
you can use hoogle type of questions. basically, type of function you're looking -- in our case have list [a]
, a
search , want return of [int]
indices -- , search it (in case, first result, elemindices
, seems work)
Comments
Post a Comment