From 2ce9f3af8a25f0ff3488a14ae2883111447f1c9c Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 16 Nov 2001 15:33:53 +0000 Subject: [PATCH] [project @ 2001-11-16 15:33:53 by simonpj] Correct docs about SPECIALIZE instance; MERGE TO STABLE --- ghc/docs/users_guide/glasgow_exts.sgml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index da5c497..20d164d 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -2627,12 +2627,17 @@ i2d (I# i) = D# (int2Double# i) -- uses Glasgow prim-op directly Same idea, except for instance declarations. For example: -instance (Eq a) => Eq (Foo a) where { ... usual stuff ... } - -{-# SPECIALIZE instance Eq (Foo [(Int, Bar)] #-} +instance (Eq a) => Eq (Foo a) where { + {-# SPECIALIZE instance Eq (Foo [(Int, Bar)]) #-} + ... usual stuff ... + } - -Compatible with HBC, by the way. +The pragma must occur inside the where part +of the instance declaration. + + +Compatible with HBC, by the way, except perhaps in the placement +of the pragma. -- 1.7.10.4