From 315c25ab86177f85f8c316f79a789675b792f6bd Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 29 Sep 2004 09:49:21 +0000 Subject: [PATCH] [project @ 2004-09-29 09:49:21 by ross] revise the description of rebindable syntax to match what it seems to do --- ghc/docs/users_guide/glasgow_exts.xml | 44 +++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.xml b/ghc/docs/users_guide/glasgow_exts.xml index 2412451..36958c9 100644 --- a/ghc/docs/users_guide/glasgow_exts.xml +++ b/ghc/docs/users_guide/glasgow_exts.xml @@ -835,26 +835,38 @@ This name is not supported by GHC. return, are in scope (not the Prelude versions). List comprehensions, and parallel array comprehensions, are unaffected. + + + Similarly recursive do notation (see + ) uses whatever + mfix function is in scope, and arrow + notation (see ) + uses whatever arr, + (>>>), first, + app, (|||) and + loop functions are in scope. + - Be warned: this is an experimental facility, with fewer checks than - usual. In particular, it is essential that the functions GHC finds in scope - must have the appropriate types, namely: + The functions with these names that GHC finds in scope + must have types matching those of the originals, namely: - fromInteger :: forall a. (...) => Integer -> a - fromRational :: forall a. (...) => Rational -> a - negate :: forall a. (...) => a -> a - (-) :: forall a. (...) => a -> a -> a - (>>=) :: forall m a. (...) => m a -> (a -> m b) -> m b - (>>) :: forall m a. (...) => m a -> m b -> m b - return :: forall m a. (...) => a -> m a - fail :: forall m a. (...) => String -> m a + fromInteger :: Integer -> N + fromRational :: Rational -> N + negate :: N -> N + (-) :: N -> N -> N + (>>=) :: forall a b. M a -> (a -> M b) -> M b + (>>) :: forall a b. M a -> M b -> M b + return :: forall a. a -> M a + fail :: forall a. String -> M a - (The (...) part can be any context including the empty context; that part - is up to you.) - If the functions don't have the right type, very peculiar things may - happen. Use -dcore-lint to - typecheck the desugared program. If Core Lint is happy you should be all right. + (Here N may be any type, + and M any type constructor.) + + Be warned: this is an experimental facility, with + fewer checks than usual. Use -dcore-lint + to typecheck the desugared program. If Core Lint is happy + you should be all right. -- 1.7.10.4