Commit ffe56607 authored by simonpj's avatar simonpj
Browse files

[project @ 2004-12-03 12:19:51 by simonpj]

Add nameModule; and PrimTyConI
parent 3e3bb285
......@@ -14,6 +14,7 @@ module Language.Haskell.TH(
mkName, -- :: String -> Name
newName, -- :: String -> Q Name
nameBase, -- :: Name -> String
nameModule, -- :: Name -> Maybe String
tupleTypeName, tupleDataName, -- Int -> Name
-- The algebraic data types
......
......@@ -22,7 +22,7 @@ module Language.Haskell.TH.Syntax(
currentModule, runIO,
-- Names
Name(..), mkName, newName, nameBase,
Name(..), mkName, newName, nameBase, nameModule,
-- The algebraic data types
Dec(..), Exp(..), Con(..), Type(..), Cxt, Match(..),
......@@ -297,6 +297,10 @@ type Uniq = Int
nameBase :: Name -> String
nameBase (Name occ _) = occString occ
nameModule :: Name -> Maybe String
nameModule (Name _ (NameG _ m)) = Just (modString m)
nameModule other_name = Nothing
mkName :: String -> Name
mkName s = Name (mkOccName s) NameS
......@@ -375,6 +379,13 @@ data Info
Fixity
| TyConI Dec
| PrimTyConI -- Ones that can't be expressed with a data type
-- decl, such as (->), Int#
Name
Int -- Arity
Bool -- False => lifted type; True => unlifted
| DataConI
Name -- The data con itself
Type -- Type of the constructor (fully polymorphic)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment