X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=f8ad5c1b0ac8a79f9ee96c6a4227e6abafcaa6e7;hp=09fd3f509fd4efbab42e79ee8ffaa3e7e508f797;hb=9da4639011348fb6c318e3cba4b08622f811d9c4;hpb=bebf54b1fefef0c337955ec1e653b44f4ec63d10 diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 09fd3f5..f8ad5c1 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -3301,6 +3301,7 @@ changing the program. A lexically scoped type variable can be bound by: A declaration type signature () +An expression type signature () A pattern type signature () Class and instance declarations () @@ -3352,6 +3353,23 @@ quantification rules. + +Expression type signatures + +An expression type signature that has explicit +quantification (using forall) brings into scope the +explicitly-quantified +type variables, in the annotated expression. For example: + + f = runST ( (op >>= \(x :: STRef s Int) -> g x) :: forall s. ST s Bool ) + +Here, the type signature forall a. ST s Bool brings the +type variable s into scope, in the annotated expression +(op >>= \(x :: STRef s Int) -> g x). + + + + Pattern type signatures