Proposal: Add variants of tails & inits not returning empty lists

Maxime Henrion mux at FreeBSD.org
Fri Dec 14 11:17:38 EST 2007


	Hi all,


I just opened a Trac ticket (#1979), to suggest the addition of the
inits1 and tails1 functions, which don't return empty lists unlike
their counterpart.  They're defined as such :

inits1 = tail . inits
tails1 = init . tails

I've needed them a few times so I thought they would make a nice
addition to the base package.  And, I've got to say, the symmetry
in this code is is nice :-).

http://hackage.haskell.org/trac/ghc/ticket/1979

Cheers,
Maxime


More information about the Libraries mailing list