X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=0beed8e3123f66fa056938001cce22e2b566d886;hb=dfcf88523ec5988fbcaa2cbf812cc5862ad621cf;hp=6b41b39057bbdd4cc4f3b81ebfbc72af919610d6;hpb=3eeeb57d95c6a218ce457f85e1f5b3511057101f;p=ghc-hetmet.git diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 6b41b39..0beed8e 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -128,6 +128,45 @@ documentation describes all the libraries that come with GHC. + : + + + + + As an experimental change, we are exploring the possibility of + making pattern bindings monomorphic; that is, not generalised at all. + A pattern binding is a binding whose LHS has no function arguments, + and is not a simple variable. For example: + + f x = x -- Not a pattern binding + f = \x -> x -- Not a pattern binding + f :: Int -> Int = \x -> x -- Not a pattern binding + + (g,h) = e -- A pattern binding + (f) = e -- A pattern binding + [x] = e -- A pattern binding + +Experimentally, GHC now makes pattern bindings monomorphic by +default. Use to recover the +standard behaviour. + + + + + + + : + + + + Use GHCi's extended default rules in a regular module (). + Independent of the + flag. + + + + + @@ -140,7 +179,7 @@ documentation describes all the libraries that come with GHC. - + @@ -617,7 +656,7 @@ clunky env var1 var1 = case lookup env var1 of Nothing -> fail Just val2 -> val1 + val2 where - fail = val1 + val2 + fail = var1 + var2 @@ -2090,7 +2129,7 @@ option, you can use arbitrary types in both an instance context and instance head. Termination is ensured by having a fixed-depth recursion stack. If you exceed the stack depth you get a sort of backtrace, and the opportunity to increase the stack depth -with N. +with N. @@ -6072,7 +6111,7 @@ shortcoming is something that could be fixed, with some kind of pragma.) - The <literal>inline</literal> function + The <literal>lazy</literal> function The lazy function restrains strictness analysis a little: @@ -6097,6 +6136,21 @@ look strict in y which would defeat the whole purpose of par. + + The <literal>unsafeCoerce#</literal> function + +The function unsafeCoerce# allows you to side-step the +typechecker entirely. It has type + + unsafeCoerce# :: a -> b + +That is, it allows you to coerce any type into any other type. If you use this +function, you had better get it right, otherwise segmentation faults await. +It is generally used when you want to write a program that you know is +well-typed, but where Haskell's type system is not expressive enough to prove +that it is well typed. + +