# f1eb3e094fb170438139a031a28a68ad123a6804f21e8edea77fc490f35b88ba Elan 2.0.0-alpha valid

function merge(a as List<of String>, b as List<of String>) returns List<of String>
  variable result set to new List<of String>()
  if a.length() is 0 then
    reassign result to b
  elif b.length() is 0 then
    reassign result to a
  else
    variable head_a, tail_a set to a
    variable head_b, tail_b set to b
    if head_a.isBefore(head_b) then
      reassign result to [head_a].withAppendList(merge(tail_a, b))
    else
      reassign result to [head_b].withAppendList(merge(a, tail_b))
    end if
  end if
  return result
end function
