Language.C.Data.Name

language-c-0.6.1: Analysis and generation of C code

Copyright | (c) 2008 Benedikt Huber
License | BSD-style
Maintainer | benedikt.huber@gmail.com
Stability | experimental
Portability | ghc
Safe Haskell | None
Language | Haskell98

Language.C.Data.Name

Description

Unique Names with fast equality (newtype `Int`)

Synopsis

- newtype Name = Name {
  - nameId :: Int
  }
- newNameSupply :: [Name]
- namesStartingFrom :: Int -> [Name]

# Documentation

newtype Name #

Name is a unique identifier

Constructors

Name |
Fields nameId :: Int

Instances

Enum Name # |
Methods succ :: Name -> Name # pred :: Name -> Name # toEnum :: Int -> Name # fromEnum :: Name -> Int # enumFrom :: Name -> [Name] # enumFromThen :: Name -> Name -> [Name] # enumFromTo :: Name -> Name -> [Name] # enumFromThenTo :: Name -> Name -> Name -> [Name] #
Eq Name # |
Methods (==) :: Name -> Name -> Bool # (/=) :: Name -> Name -> Bool #
Data Name # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name # toConstr :: Name -> Constr # dataTypeOf :: Name -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Name) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) # gmapT :: (forall b. Data b => b -> b) -> Name -> Name # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name #
Ord Name # |
Methods compare :: Name -> Name -> Ordering # (<) :: Name -> Name -> Bool # (<=) :: Name -> Name -> Bool # (>) :: Name -> Name -> Bool # (>=) :: Name -> Name -> Bool # max :: Name -> Name -> Name # min :: Name -> Name -> Name #
Read Name # |
Methods readsPrec :: Int -> ReadS Name # readList :: ReadS [Name] # readPrec :: ReadPrec Name # readListPrec :: ReadPrec [Name] #
Show Name # |
Methods showsPrec :: Int -> Name -> ShowS # show :: Name -> String # showList :: [Name] -> ShowS #
Ix Name # |
Methods range :: (Name, Name) -> [Name] # index :: (Name, Name) -> Name -> Int # unsafeIndex :: (Name, Name) -> Name -> Int inRange :: (Name, Name) -> Name -> Bool # rangeSize :: (Name, Name) -> Int # unsafeRangeSize :: (Name, Name) -> Int

newNameSupply :: [Name] #

return an infinite stream of `Name`s starting with `nameId` 0

namesStartingFrom :: Int -> [Name] #

get the infinite stream of unique names starting from the given integer