它可以插入不同类型的可存储对象的列表{-# LANGUAGE RankNTypes, ExistentialQuantification, ImpredicativeTypes然后我创建了一些数据类型{-# LANGUAGE RankNTypes, ExistentialQuantification, ImpredicativeTypes
对于我和我真正想要的清单来说,最直接的类型是:aList :: [forall a.Show a => a]此外,()ImpredicativeTypes“最好是脆弱的,最坏的是坏的”,它没有编译:
Couldn't match与有问题的ImpredicativeTypes不同,人们可能更喜欢更稳定和更广泛接受的RankNTypes。这基本上意味着:将所需的forall a.