#3671: Add partitioning functions to Data.List
---------------------------------+------------------------------------------
Reporter: holzensp | Owner:
Type: proposal | Status: new
Priority: normal | Component: libraries/base
Version: 6.12.1 RC1 | Keywords: Data.List
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
The functions `take` and `span` have recursive equivalents `takeRec` and
`spanRec` that apply the same function to the remainder, i.e.
{{{
takeRec i xs = let (hs,ts) = splitAt i xs in hs : takeRec i xs
spanRec p xs = let (hs,ts) = span p xs in hs : spanRec p xs
}}}
and the more generic version of `take`:
{{{
genericTakeRec i xs = let (hs,ts) = genericSplitAt i xs in hs :
genericTakeRec i xs
}}}
These functions, to me, are in the same league as `partition` and `group`,
can be added with little chance of nameclashes on functions with a
different meaning and are not named compositions.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3671>
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