Abhiroop / okasaki

A Haskell Collections library. [WIP]
BSD 3-Clause "New" or "Revised" License
15 stars 3 forks source link

Add missing cases in fuse (empty subtrees) #3

Open ochsnerd opened 3 months ago

ochsnerd commented 3 months ago

When fusing two trees, their subtrees may be just leaves, resulting in the recursive call to fuse returning a leaf. This case does not introduce any new logic, but has to be handled in the patterns. fixes #2

minimal example where the missing case results in an error:

delete 3 (foldr insert empty [1..4])