From f2c6879637426228502fd42ae9afa3404e57f014 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 18 Mar 2002 15:27:08 +0000 Subject: [PATCH] [project @ 2002-03-18 15:27:08 by simonpj] More on linear implicit params --- ghc/docs/users_guide/glasgow_exts.sgml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index bc6dd13..282df11 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -918,12 +918,14 @@ written '%x' instead of '?x'. For example: + import GHC.Exts( Splittable ) + data NameSupply = ... splitNS :: NameSupply -> (NameSupply, NameSupply) newName :: NameSupply -> Name - instance PrelSplit.Splittable NameSupply where + instance Splittable NameSupply where split = splitNS @@ -954,7 +956,7 @@ the parameter explicit: Notice the call to 'split' introduced by the type checker. How did it know to use 'splitNS'? Because what it really did was to introduce a call to the overloaded function 'split', -defined by +defined by the class Splittable: class Splittable a where split :: a -> (a,a) @@ -968,8 +970,8 @@ and GHC will infer g :: (Splittable a, %ns :: a) => b -> (b,a,a) -The Splittable class is built into GHC. It's defined in PrelSplit, -and exported by GlaExts. +The Splittable class is built into GHC. It's exported by module +GHC.Exts. Other points: -- 1.7.10.4