我很好奇 getZipList 在 ghc 中的定义位置。Control.Applicative 对 ZipList 有这个定义。
newtype ZipList a = ZipList { getZipList :: [a] }
使用 ZipLists 的一种方法是(来自 LYAH):
ghci> getZipList $ (+) <$> ZipList [1,2,3] <*> ZipList [100,100,100]
[101,102,103]
我很好奇 getZipList 如何知道要返回什么。也许我错过了关于 newtype 关键字的一些东西。谢谢!