map* for Data.List

Samuel Bronson naesten at
Sat Nov 4 19:02:29 EST 2006

On 11/4/06, Taral <taralx at> wrote:
> On 11/4/06, Bulat Ziganshin <bulat.ziganshin at> wrote:
> > Hello libraries,
> >
> > similar to mapFst and Co, we can define:
> >
> > -- |Map various parts of list
> I don't think this is really that useful. Lists are homogeneous,
> tuples are heterogeneous.

Hmm, from the first two lines, I was expecting

mapHead :: (a -> a) -> [a] -> [a]

as given by Bulat, but also

mapTail :: ([a] -> [a]) -> [a] -> [a]

instead of

mapTail :: (a -> a) -> [a] -> [a]

I wasn't expecting the other two at all, but I would have expected
mapInit to have a similar type to mapTail. (But really, I wouldn't
have wanted those. Not that I'm sure I'd want either of the first

More information about the Libraries mailing list