From 77a4675ae3ba1c53d60b54cc23316f764cae281e Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 5 Jun 2009 12:29:29 +0000 Subject: [PATCH] Update the docs on how you bind unlifted types in let/where clauses --- docs/users_guide/glasgow_exts.xml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index a08ace9..e8e721c 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -210,22 +210,20 @@ in a top-level binding. in a recursive binding. You may bind unboxed variables in a (non-recursive, -non-top-level) pattern binding, but any such variable causes the entire -pattern-match -to become strict. For example: +non-top-level) pattern binding, but you must make any such pattern-match +strict. For example, rather than: data Foo = Foo Int Int# f x = let (Foo a b, w) = ..rhs.. in ..body.. -Since b has type Int#, the entire pattern -match -is strict, and the program behaves as if you had written +you must write: data Foo = Foo Int Int# - f x = case ..rhs.. of { (Foo a b, w) -> ..body.. } + f x = let !(Foo a b, w) = ..rhs.. in ..body.. +since b has type Int#. -- 1.7.10.4