#1464: Proposal: add dropPrefix to Data.List
-----------------------------+----------------------------------------------
Reporter: igloo | Owner:
Type: proposal | Status: new
Priority: normal | Milestone: Not GHC
Component: libraries/base | Version: 6.6.1
Severity: normal | Keywords:
Difficulty: Unknown | Os: Unknown
Testcase: | Architecture: Unknown
-----------------------------+----------------------------------------------
I seem to have a copy of this function in everything I write sooner or
later, so I'd like to propose its addition to Data.List. It strips a
prefix from a list and, if successful, returns the tail. I often use it
with pattern guards:
{{{
foo :: String -> IO ()
foo x
| Just y <- dropPrefix "foo=" = putStrLn ("foo is " ++ show y)
foo _ = putStrLn "Unknown"
}}}
but you can of course achieve the same by using case etc.
Let's try 11 July for a discussion deadline.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1464>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs