Sometimes, I want to do <> on lists but add sizes strictly to avoid space leaks. The size field of the Slist data structure is intentionally lazy to make some functions work and not hang on some corner cases (or maybe to have a better lazy semantics). So having a separate function like append' probably won't hurt :slightly_smiling_face:
I also often use concatMap to combine a lot of lists, so having concatMap' will be nice as well :+1:
Both strict append' and concatMap' can be faster my skipping empty lists. This is especially relevant when you want to append a lot of lists of size 0 or 1.
Alternatively, we can change the definition of <> itself, but dealing with laziness is difficult, so probably we can introduce a few separate functions.
Sometimes, I want to do
<>
on lists but add sizes strictly to avoid space leaks. The size field of theSlist
data structure is intentionally lazy to make some functions work and not hang on some corner cases (or maybe to have a better lazy semantics). So having a separate function likeappend'
probably won't hurt :slightly_smiling_face:I also often use
concatMap
to combine a lot of lists, so havingconcatMap'
will be nice as well :+1:Both strict
append'
andconcatMap'
can be faster my skipping empty lists. This is especially relevant when you want to append a lot of lists of size 0 or 1.Alternatively, we can change the definition of
<>
itself, but dealing with laziness is difficult, so probably we can introduce a few separate functions.