From d11718fa4d13519e48ef72d0b932972ce806730b Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Mon, 24 Aug 2009 11:37:22 +0000 Subject: [PATCH] Improve docs on -XFlexibleContexts --- docs/users_guide/glasgow_exts.xml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 4e541a6..bf2e9ac 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -3157,7 +3157,8 @@ All the extensions are enabled by the flag. Multi-parameter type classes -Multi-parameter type classes are permitted. For example: +Multi-parameter type classes are permitted, with flag . +For example: @@ -3169,13 +3170,17 @@ Multi-parameter type classes are permitted. For example: - + The superclasses of a class declaration -There are no restrictions on the context in a class declaration -(which introduces superclasses), except that the class hierarchy must -be acyclic. So these class declarations are OK: +In Haskell 98 the context of a class declaration (which introduces superclasses) +must be simple; that is, each predicate must consist of a class applied to +type variables. The flag +() +lifts this restriction, +so that the only restriction on the context in a class declaration is +that the class hierarchy must be acyclic. So these class declarations are OK: @@ -4723,7 +4728,11 @@ these type signatures are perfectly OK g :: Eq [a] => ... g :: Ord (T a ()) => ... +The flag also lifts the corresponding +restriction on class declarations () and instance declarations +(). + GHC imposes the following restrictions on the constraints in a type signature. Consider the type: -- 1.7.10.4