X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FbasicTypes%2FOccName.lhs;h=92351d65896f3c32fd1f7f12b1e18eb1cebb3be2;hp=13a7f81cd3ef77230745bd4cb61bf192cb95ef40;hb=49c98d143c382a1341e1046f5ca00819a25691ba;hpb=909d2dd885f5eebaf7c12cf15d5ac153d646566e diff --git a/compiler/basicTypes/OccName.lhs b/compiler/basicTypes/OccName.lhs index 13a7f81..92351d6 100644 --- a/compiler/basicTypes/OccName.lhs +++ b/compiler/basicTypes/OccName.lhs @@ -1,10 +1,8 @@ -{-% DrIFT (Automatic class derivations for Haskell) v1.1 %-} % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -\section[OccName]{@OccName@} - \begin{code} module OccName ( -- * The NameSpace type; abstact @@ -65,19 +63,18 @@ module OccName ( #include "HsVersions.h" -import Util ( thenCmp ) -import Unique ( Unique, mkUnique, Uniquable(..) ) -import BasicTypes ( Boxity(..), Arity ) -import StaticFlags ( opt_PprStyle_Debug ) +import Util +import Unique +import BasicTypes +import StaticFlags import UniqFM import UniqSet import FastString import Outputable import Binary -import GLAEXTS - -import Data.Char ( isUpper, isLower, ord ) +import GHC.Exts +import Data.Char -- Unicode TODO: put isSymbol in libcompat #if __GLASGOW_HASKELL__ > 604 @@ -442,7 +439,8 @@ mkDictOcc = mk_simple_deriv varName "$d" mkIPOcc = mk_simple_deriv varName "$i" mkSpecOcc = mk_simple_deriv varName "$s" mkForeignExportOcc = mk_simple_deriv varName "$f" -mkNewTyCoOcc = mk_simple_deriv tcName "Co" +mkNewTyCoOcc = mk_simple_deriv tcName ":Co" +mkInstTyCoOcc = mk_simple_deriv tcName ":Co" -- derived from rep ty -- Generic derivable classes mkGenOcc1 = mk_simple_deriv varName "$gfrom" @@ -478,25 +476,15 @@ mkLocalOcc uniq occ -- that need encoding (e.g. 'z'!) \end{code} -\begin{code} - --- Derive a name for the representation type constructor of a data/newtype --- instance. --- -mkInstTyTcOcc :: Unique -- Unique - -> OccName -- Local name (e.g. "Map") - -> OccName -- Nice unique version (":T23Map") -mkInstTyTcOcc uniq occ - = mk_deriv varName (":T" ++ show uniq) (occNameString occ) - --- Derive a name for the coercion of a data/newtype instance. --- -mkInstTyCoOcc :: Unique -- Unique - -> OccName -- Local name (e.g. "Map") - -> OccName -- Nice unique version ("Co23Map") -mkInstTyCoOcc uniq occ - = mk_deriv varName ("Co" ++ show uniq) (occNameString occ) +Derive a name for the representation type constructor of a data/newtype +instance. +\begin{code} +mkInstTyTcOcc :: Int -- Index + -> OccName -- Family name (e.g. "Map") + -> OccName -- Nice unique version (":R23Map") +mkInstTyTcOcc index occ + = mk_deriv tcName (":R" ++ show index) (occNameString occ) \end{code} \begin{code}