X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=b2daa16709225747cb102764c71ff752a145977b;hb=3e4ee05cb301bd9f10d6a64b610c21c1f890f50b;hp=c370ce3388308a602a0f020a8745652fed0b5d3e;hpb=ea283aa74e6fd2bec2b88eae19908bba903adea1;p=ghc-hetmet.git diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index c370ce3..b2daa16 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -4807,7 +4807,7 @@ f !x = 3 Is this a definition of the infix function "(!)", or of the "f" with a bang pattern? GHC resolves this -ambiguity inf favour of the latter. If you want to define +ambiguity in favour of the latter. If you want to define (!) with bang-patterns enabled, you have to do so using prefix notation: @@ -6130,6 +6130,22 @@ r) -> described in this section. All are exported by GHC.Exts. + The <literal>seq</literal> function + +The function seq is as described in the Haskell98 Report. + + seq :: a -> b -> b + +It evaluates its first argument to head normal form, and then returns its +second argument as the result. The reason that it is documented here is +that, despite seq's polymorphism, its +second argument can have an unboxed type, or +can be an unboxed tuple; for example (seq x 4#) +or (seq x (# p,q #)). This requires b +to be instantiated to an unboxed type, which is not usually allowed. + + + The <literal>inline</literal> function The inline function is somewhat experimental. @@ -6188,6 +6204,11 @@ If lazy were not lazy, par would look strict in y which would defeat the whole purpose of par. + +Like seq, the argument of lazy can have +an unboxed type. + + The <literal>unsafeCoerce#</literal> function @@ -6203,7 +6224,14 @@ 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. + +The argument to unsafeCoerce# can have unboxed types, +although extremely bad things will happen if you coerce a boxed type +to an unboxed type. + + +