Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在使用 Haskell 时遇到了一些麻烦。我正在寻找一个可以比较 2 个字符串的函数。该函数应输出一个字符串,其中包含两个字符串中的字符。
提前致谢。
您正在寻找的是可以与 2 个列表的元素相交的一些功能[a]。
[a]
有一个来自Data.List : intersect :: Eq a => [a] -> [a] -> [a]。
intersect :: Eq a => [a] -> [a] -> [a]
> intersect "abcd" "db" "bd" it :: [Char]