There are two things you might think of when you think of scanr;
or rather, there are two things I think of: a specification
scanr f e = map (foldr f e) . tails
and an implementation
scanr f e = foldr g [e] where g x yss@(ys:_) = f x ys : yss
Of course these two differ, because
I think this discussion would be more appropriate to the libraries list.
On Nov 9, 2017 11:05 AM, "Geraint Jones"
wrote:
> There are two things you might think of when you think of scanr;
> or rather, there are two things I think of: a specification
>
> scanr f e = map (foldr f e) . tail