------------------------------------
-- Text utility functions
------------------------------------


-- | @over upper lower@ places @upper@ over @lower@. The resulting string has the same characters as @upper@ does, except where @upper@ contains spaces; at those positions, the character from @lower@ shows. If @lower@ is longer than @upper@, @upper@ is padded with enough spaces to show all rest of @lower@.
over :: String -> String -> String
over upper lower = take n $ zipWith f (pad upper) (pad lower)
  where f ' ' b = b
        f  a  _ = a
        pad = (++ repeat ' ')
        n = length upper `max` length lower

-- | Merge folds many strings 'over' each other.
over :: String -> String -> String
over upper lower = take n $ zipWith f (pad upper) (pad lower)
  where f ' ' b = b
        f  a  _ = a
        pad = (++ repeat ' ')
        n = length upper `max` length lower

-- | Merge folds many strings 'over' each other.
over upper lower = take n $ zipWith f (pad upper) (pad lower)
  where f ' ' b = b
        f  a  _ = a
        pad = (++ repeat ' ')
        n = length upper `max` length lower

-- | Merge folds many strings 'over' each other.