{- An implementation of merge sort using braun trees. This is mostly adapted from the formalisation in the iowa agda library (https://github.com/cedille/ial) -} -- These imports depend on the agda standard library (https://github.com/agda/agda-stdlib) open import Data.List using (List ; [] ; _∷_ ; length) open import Data.Bool using (Bool ; true ; false ; if_then_else_) open import Data.Nat open import Data.Nat.Properties using (+-comm) open import Data.Sum open import Relation.Binary.PropositionalEquality module merge where module braun-tree {ℓ} (A : Set ℓ) (_