Skip to content

Instantly share code, notes, and snippets.

@cesare
Created February 7, 2010 08:21
Show Gist options
  • Save cesare/297305 to your computer and use it in GitHub Desktop.
Save cesare/297305 to your computer and use it in GitHub Desktop.
remains :: (Eq a) => [a] -> a -> Int
remains lst key = length (dropWhile (/= key) lst) -1
-- inspired by yuroyoro.
-- see also http://d.hatena.ne.jp/yuroyoro/20100205/1265363784
-- http://kaitenn.blogspot.com/2010/01/scala-list.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment