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
fromList: ... This function is implemented with ++. Repeated uses of fromList are just as inefficient as repeated uses of ++.
So, are those 5 parallel fromLists there to do mconcat gain anything, or they are added complexity. & it is having the simple statement that DList.fromList is implemented in terms of ++. But what ++ traverses there & how many times chunks are traversed are still radically different from "just being ++" - in that source pattern conversion into DList I believe allows to save on retraverse, which ++ would do there.
As the most frequent way to construct datatypes is fromList.
And the OverloadedLists is here, together with the standardized IsList interface which it operates on.
During
DList
use I had a difficulty to reason about:https://github.com/haskell/haskell-language-server/blob/2e61b7c0ba64cded22cf0fb80b089eaf328528e6/ghcide/src/Development/IDE/Core/Compile.hs#L475-L483
Because
DList
docs state:So, are those 5 parallel
fromList
s there to domconcat
gain anything, or they are added complexity. & it is having the simple statement thatDList.fromList
is implemented in terms of++
. But what++
traverses there & how many times chunks are traversed are still radically different from "just being++
" - in that source pattern conversion intoDList
I believe allows to save on retraverse, which++
would do there.As the most frequent way to construct datatypes is
fromList
.And the
OverloadedLists
is here, together with the standardizedIsList
interface which it operates on.And in the preparation for the https://github.com/fumieval/Haskell-breaking-changes#upcoming-monomorphise-datalist arrival.
It would be useful to get the tables of
to/fromList
conversion to see the weights of transforming the data types in the most default way.The text was updated successfully, but these errors were encountered: