通常我發現我想編寫兩個函數f和g,但g需要多個參數。哈斯克爾是否提供了一組運營商所提供的(我知道我可以寫我自己,但似乎相當普遍的,我不想重複已經存在於哈斯克爾運營商) 即像 ([email protected]) = (.)
([email protected]@) f g x1 x2 = f $ g x1 x2
([email protected]@@) f g x1 x2 x3 = f $
編譯這是工作 unique :: (a -> Bool) -> [a] -> Bool
unique p xs = 1 == length (filter p xs)
但現在我想它的形式: unique = (== 1) . length . filter
錯誤消息: Couldn't match expected type `[a] -> Bool' with actual type