Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • What should this be doing? Could you provide a test case or 2? Commented Feb 13, 2013 at 2:16
  • its a standard .index() function on an array I believe. I believe he's expecting this to return the index of the element within the list e.g.: whatIndex 17 [1,2,3,4,5,15,16,17,19] = 7 Commented Feb 13, 2013 at 2:19
  • Yes, basically I am making an index function. I can't seem to get the logic figured out as to how to increment index. Commented Feb 13, 2013 at 2:26
  • BTW, what you really want here is a function that returns Maybe Int, because you want to make it clear in the type that the function is partial. Such a function, elemIndex, already exists in Data.List--you can take a look at the source here. Commented Feb 13, 2013 at 4:24