-- compares 2 strings (emails) and returns the common part if any
compareEmailTail :: Email -> Email -> Maybe String
compareEmailTail email1 email2
  | common > 0 = Just $ reverse $ take common remail1
  | otherwise = Nothing
  where
    remail1 = reverse email1
    remail2 = reverse email2
    common = commonPart remail1 remail2 0
-- <<<
compareEmailTail :: Email -> Email -> Maybe String
compareEmailTail email1 email2
  | common > 0 = Just $ reverse $ take common remail1
  | otherwise = Nothing
  where
    remail1 = reverse email1
    remail2 = reverse email2
    common = commonPart remail1 remail2 0
-- <<<
compareEmailTail email1 email2
  | common > 0 = Just $ reverse $ take common remail1
  | otherwise = Nothing
  where
    remail1 = reverse email1
    remail2 = reverse email2
    common = commonPart remail1 remail2 0
-- <<<