
15 Aug
2014
15 Aug
'14
4:06 a.m.
On Fri, Aug 15, 2014 at 12:05 AM, wren romano
unfoldr1 :: (b -> (a, Maybe b)) -> b -> [a] unfoldr1 f = unfoldr (fmap f) . Just
Note that unless unfoldr is inlined whenever its first argument is supplied, the use of (Maybe b) as the seed type means you'll get a lot more allocation and case analysis than in your direct definition.
i.e., using (Maybe b) as the type of the seed used by unfoldr -- Live well, ~wren