Data.List.viewL (was: Proposal: add 'equating' function to Data.List)

Henning Thielemann schlepptop at henning-thielemann.de
Fri Jul 18 21:23:59 UTC 2014


Am 18.07.2014 23:19, schrieb David Feuer:

> What I'd like for Data.List is
>
> uncons :: [a] -> Maybe (a, [a]).
> uncons [] = Nothing
> uncons (a:as) = Just (a,as)
>
> I believe Data.Text and maybe even Data.ByteString have similar
> functions.

I called it viewL, analogously to Data.Sequence:
 
http://hackage.haskell.org/package/utility-ht-0.0.10/docs/Data-List-HT.html#v:viewL



More information about the Libraries mailing list