X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=656d2db563c3171344d0bcd70f4dcfc618b8764a;hb=c30bedd511c983b5f2b0dae4d4cc5a2baa1cb0c2;hp=f6ca80ee87d0fc26145ec293f416184a6a09316a;hpb=95f023d8efdf6873debc2549e0071dedb1b660cc;p=ghc-hetmet.git diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index f6ca80e..656d2db 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -323,11 +323,11 @@ became out of date, and wrong information is worse than none. The Real Truth about what primitive types there are, and what operations work over those types, is held in the file -fptools/ghc/compiler/prelude/primops.txt.pp. +compiler/prelude/primops.txt.pp. This file is used directly to generate GHC's primitive-operation definitions, so it is always correct! It is also intended for processing into text. - Indeed, +Indeed, the result of such processing is part of the description of the External @@ -366,6 +366,20 @@ would use in C: Int# (long int), know and love—usually one instruction. + For some primitive types we have special syntax for literals. +Anything that would be an integer lexeme followed by a +# is an Int# literal, e.g. +32# and -0x3A#. Likewise, +any non-negative integer literal followed by +## is a Word# literal. +Likewise, any floating point literal followed by a +# is a Float# literal, and +followed by ## is a +Double#. Finally, a string literal followed by a +#, e.g. "foo"#, +is a Addr# literal. + + Primitive (unboxed) types cannot be defined in Haskell, and are therefore built into the language and compiler. Primitive types are @@ -6767,7 +6781,7 @@ infeasible in most interesting cases. The responsibility is entirely the progra terminating. For example: - "loop" forall x,y. f x y = f y x + "loop" forall x y. f x y = f y x This rule will cause the compiler to go into an infinite loop.