diff options
author | ross <unknown> | 2004-09-29 09:49:21 +0000 |
---|---|---|
committer | ross <unknown> | 2004-09-29 09:49:21 +0000 |
commit | 315c25ab86177f85f8c316f79a789675b792f6bd (patch) | |
tree | 1f15c962c325816ece76f4a5b8ee31fdc4262c60 /ghc/docs | |
parent | 07291441614c93357b813f7d4d007e9c32636582 (diff) | |
download | haskell-315c25ab86177f85f8c316f79a789675b792f6bd.tar.gz |
[project @ 2004-09-29 09:49:21 by ross]
revise the description of rebindable syntax to match what it seems to do
Diffstat (limited to 'ghc/docs')
-rw-r--r-- | ghc/docs/users_guide/glasgow_exts.xml | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/ghc/docs/users_guide/glasgow_exts.xml b/ghc/docs/users_guide/glasgow_exts.xml index 241245143d..36958c9b04 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. <literal>return</literal>, are in scope (not the Prelude versions). List comprehensions, and parallel array comprehensions, are unaffected. </para></listitem> + + <listitem> + <para>Similarly recursive do notation (see + <xref linkend="mdo-notation"/>) uses whatever + <literal>mfix</literal> function is in scope, and arrow + notation (see <xref linkend="arrow-notation"/>) + uses whatever <literal>arr</literal>, + <literal>(>>>)</literal>, <literal>first</literal>, + <literal>app</literal>, <literal>(|||)</literal> and + <literal>loop</literal> functions are in scope.</para> + </listitem> </itemizedlist> - <para>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: + <para>The functions with these names that GHC finds in scope + must have types matching those of the originals, namely: <screen> - 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 </screen> - (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 <literal>-dcore-lint</literal> to - typecheck the desugared program. If Core Lint is happy you should be all right.</para> + (Here <literal>N</literal> may be any type, + and <literal>M</literal> any type constructor.)</para> + + <para>Be warned: this is an experimental facility, with + fewer checks than usual. Use <literal>-dcore-lint</literal> + to typecheck the desugared program. If Core Lint is happy + you should be all right.</para> </sect2> </sect1> |