Hi Edward,

I started @telling you on #haskell, but it has become
too long for that. :)

The following functions would be nice additions
to Data.List.NonEmpty in the semigroups package:

replicate1p :: Whole n => n -> a -> NonEmpty a
take1p :: Whole n => n -> NonEmpty a -> NonEmpty a
splitAt1p :: Whole n => n -> NonEmpty a -> (NonEmpty a, [a])

Also, your warnings in the haddocks about blowing up on negative
arguments don't seem to be needed for take, drop, and splitAt.

We could avoid the problem with negative arguments for (!!)
too by providing an alternative for Whole numbers. But in
that case the function would still be partial, so I'm not sure
if it's worth it.

I wish there were some way to get Whole to default
to Natural.

Thanks,
Yitz

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to