【发布时间】:2017-03-09 13:48:36
【问题描述】:
使用 GHC 8.0 中的 -XTypeApplications,您可以使用 @ 前面的函数参数显式指定类型。它具体指定了哪些类型,尤其是在引入多个@ 时?
【问题讨论】:
-
如果你打算使用
TypeApplications,我认为使用ExplicitForAll(或包含它的TypedScopeVariables)是个好主意,因为在这种情况下没有歧义:如果你有例如const :: forall a b. a -> b -> a,那么第一个@-参数将用于a,第二个用于b。 -
ScopedTypeVariables
标签: haskell types ghc language-extension