我不明白为什么q
's type isOrd t => [t] -> [a]
而不是Ord a => [a] -> [a]
q [] = []
q (x:xs) = q us ++ q ws
where us = filter (<=x) xs
ws = filter (>=x) xs
在什么情况下输入类型可能与输出不同?
谢谢,
塞巴斯蒂安。
我不明白为什么q
's type isOrd t => [t] -> [a]
而不是Ord a => [a] -> [a]
q [] = []
q (x:xs) = q us ++ q ws
where us = filter (<=x) xs
ws = filter (>=x) xs
在什么情况下输入类型可能与输出不同?
谢谢,
塞巴斯蒂安。