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
the default scanl is implemented with the Traversable instance of the Lazy List and does not terminate when having an infinite list.
importData.List.LazyasList-- Will not terminate even though "Lazy" may indicates the oppositefoo::MaybeInt
foo = List.head $ scanl (+) 0 $ List.cycle $ List.fromFoldable [1, 2, 3]
Should the Lazy List have a specialized scanl ?
E.g.
scanl::forallab. (b->a->b) ->b->Lista->Listb
scanl f init list = List $ defer \_ ->caseList.step list ofList.Nil->List.NilList.Cons head tail ->let val = f init head inList.Cons val (scanl f val tail)
The text was updated successfully, but these errors were encountered:
Hi,
the default
scanl
is implemented with the Traversable instance of the Lazy List and does not terminate when having an infinite list.Should the Lazy List have a specialized
scanl
?E.g.
The text was updated successfully, but these errors were encountered: