Skip to content

Instantly share code, notes, and snippets.

@jglass
Created September 27, 2010 06:05
Show Gist options
  • Save jglass/598683 to your computer and use it in GitHub Desktop.
Save jglass/598683 to your computer and use it in GitHub Desktop.
removeFst :: Int -> [Int] -> [Int]
removeFst m xs = mvOne m xs []
mvOne :: Int -> [Int] -> [Int] -> [Int]
mvOne m [] ys = mvAll [] ys
mvOne m (x:xs) ys | m /= x = mvOne m xs (x : ys)
| m == x = mvAll xs ys
mvAll :: [Int] ->[Int] -> [Int]
mvAll [] ys = reverse ys
mvAll (x:xs) ys = mvAll xs (x : ys)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment