-----------------------------------------------------------------------------
-- |
-- Module : Language.C.Data.Name
-- Copyright : (c) 2008 Benedikt Huber
-- License : BSD-style
-- Maintainer : benedikt.huber@gmail.com
-- Stability : experimental
-- Portability : ghc
--
-- Unique Names with fast equality (newtype 'Int')
-- | Name is a unique identifier
newtype Name = Name { nameId :: Int }
toEnum = Name
fromEnum (Name n) = n
-- | return an infinite stream of 'Name's starting with @nameId@ 0
newNameSupply = namesStartingFrom 0
-- | get the infinite stream of unique names starting from the given integer
namesStartingFrom k = [Name k..]