purescript-lists icon indicating copy to clipboard operation
purescript-lists copied to clipboard

List.Lazy insertAt, modifyAt, updateAt, deleteAt, alterAt members behave differently to List and Array

Open garyb opened this issue 10 years ago • 3 comments

They always return a List a even when the index is out of range, whereas the other modules return a Maybe (List a) or Array (List a) for when the operation has no effect.

garyb avatar Jun 08 '15 23:06 garyb

The reason is that we don't have a lazy Maybe. We would need at least to return Lazy (Maybe (List a)) unless we wanted to force the head element.

paf31 avatar Jun 08 '15 23:06 paf31

Yeah, I wondered if this one might be problematic. It can always go ignored if we decide it's not worth it :smile:

garyb avatar Jun 08 '15 23:06 garyb

This needs further discussion.

JordanMartinez avatar Dec 04 '21 16:12 JordanMartinez