You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mapWithIndex f = foldrWithIndex (\i x acc -> f i x : acc) nil
The implementation of FunctorWithIndex for Lazy List uses folding, which, unlike Functor, is not lazy.
It should be:
instancefunctorWithIndexList :: FunctorWithIndexIntListwhere
mapWithIndex f xs = List (go 0 <$> unwrap xs)
where
go i = \step ->case step ofNil->NilCons x xs' ->Cons (f i x) (List (go (i + 1) <$> unwrap xs'))
The text was updated successfully, but these errors were encountered:
purescript-lists/src/Data/List/Lazy/Types.purs
Line 116 in b113451
The implementation of FunctorWithIndex for Lazy List uses folding, which, unlike Functor, is not lazy.
It should be:
The text was updated successfully, but these errors were encountered: