4 ms·
You're right and looking at the example again I was completely wrong (shouldn't post without coffee). You can implement merging by writing append (+) in the cor
by fmap 9y ago
You're right and looking at the example again I was completely wrong (shouldn't post without coffee). You can implement merging by writing append (+) in the correct way. As written, the code will always insert a new element every time there is a cons (:).
One way of getting better performance "by default" is to construct lists with constructors for empty list, singletons and append and then adding equations to ensure that the resulting binary tree is balanced.