# 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
    set result to b
  elif b.length() is 0 then
    set 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
      set result to [head_a].withAppendList(merge(tail_a, b))
    else
      set result to [head_b].withAppendList(merge(a, tail_b))
    end if
  end if
  return result
end function
