-
Notifications
You must be signed in to change notification settings - Fork 10
Description
During DList use I had a difficulty to reason about:
Because DList docs state:
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.
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.