language-c-0.10.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 | Haskell2010

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 Source #

Name is a unique identifier

Constructors

Name |

Fields

- nameId :: Int

#### Instances

Instances details

NFData Name Source # |
Instance details Defined in Language.C.Data.Name Methods rnf :: Name -> () Source #
Data Name Source # |

Instance details

Defined in Language.C.Data.Name

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name Source #

toConstr :: Name -> Constr Source #

dataTypeOf :: Name -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) Source #

gmapT :: (forall b. Data b => b -> b) -> Name -> Name Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name Source #

Enum Name Source # |
Instance details Defined in Language.C.Data.Name Methods succ :: Name -> Name Source # pred :: Name -> Name Source # toEnum :: Int -> Name Source # fromEnum :: Name -> Int Source # enumFrom :: Name -> [Name] Source # enumFromThen :: Name -> Name -> [Name] Source # enumFromTo :: Name -> Name -> [Name] Source # enumFromThenTo :: Name -> Name -> Name -> [Name] Source #
Generic Name Source # |

Instance details

Defined in Language.C.Data.Name

Associated Types

type Rep Name |
Instance details Defined in Language.C.Data.Name type Rep Name = D1 ('MetaData "Name" "Language.C.Data.Name" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'True) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "nameId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

Methods

from :: Name -> Rep Name x Source #

to :: Rep Name x -> Name Source #

Ix Name Source # |
Instance details Defined in Language.C.Data.Name Methods range :: (Name, Name) -> [Name] Source # index :: (Name, Name) -> Name -> Int Source # unsafeIndex :: (Name, Name) -> Name -> Int Source # inRange :: (Name, Name) -> Name -> Bool Source # rangeSize :: (Name, Name) -> Int Source # unsafeRangeSize :: (Name, Name) -> Int Source #
Read Name Source # |
Instance details Defined in Language.C.Data.Name Methods readsPrec :: Int -> ReadS Name Source # readList :: ReadS [Name] Source # readPrec :: ReadPrec Name Source # readListPrec :: ReadPrec [Name] Source #
Show Name Source # |
Instance details Defined in Language.C.Data.Name Methods showsPrec :: Int -> Name -> ShowS Source # show :: Name -> String Source # showList :: [Name] -> ShowS Source #
Eq Name Source # |
Instance details Defined in Language.C.Data.Name Methods (==) :: Name -> Name -> Bool Source # (/=) :: Name -> Name -> Bool Source #
Ord Name Source # |
Instance details Defined in Language.C.Data.Name Methods compare :: Name -> Name -> Ordering Source # (<) :: Name -> Name -> Bool Source # (<=) :: Name -> Name -> Bool Source # (>) :: Name -> Name -> Bool Source # (>=) :: Name -> Name -> Bool Source # max :: Name -> Name -> Name Source # min :: Name -> Name -> Name Source #
type Rep Name Source # |
Instance details Defined in Language.C.Data.Name type Rep Name = D1 ('MetaData "Name" "Language.C.Data.Name" "language-c-0.10.1-IbTB6TwjqRkHrdbw3CJkeG" 'True) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "nameId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

newNameSupply :: [Name] Source #

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

namesStartingFrom :: Int -> [Name] Source #

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