Created
February 7, 2010 08:21
-
-
Save cesare/297305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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