Safe Haskell | None |
---|---|
Language | Haskell98 |
This module contains Haskell variables representing globally visible names. Rather than have strings floating around the system, all constant names should be defined here, and the (exported) variables should be used and manipulated elsewhere.
Synopsis
- data Symbol
- class Symbolic a where
- type LocSymbol = Located Symbol
- type LocText = Located Text
- symbolicString :: Symbolic a => a -> String
- symbolSafeText :: Symbol -> SafeText
- symbolSafeString :: Symbol -> String
- symbolText :: Symbol -> Text
- symbolString :: Symbol -> String
- symbolBuilder :: Symbolic a => a -> Builder
- buildMany :: [Builder] -> Builder
- isPrefixOfSym :: Symbol -> Symbol -> Bool
- isSuffixOfSym :: Symbol -> Symbol -> Bool
- isNonSymbol :: Symbol -> Bool
- isLitSymbol :: Symbol -> Bool
- isTestSymbol :: Symbol -> Bool
- isNontrivialVV :: Symbol -> Bool
- isDummy :: Symbolic a => a -> Bool
- stripPrefix :: Symbol -> Symbol -> Maybe Symbol
- stripSuffix :: Symbol -> Symbol -> Maybe Symbol
- consSym :: Char -> Symbol -> Symbol
- unconsSym :: Symbol -> Maybe (Char, Symbol)
- dropSym :: Int -> Symbol -> Symbol
- headSym :: Symbol -> Char
- lengthSym :: Symbol -> Int
- nonSymbol :: Symbol
- vvCon :: Symbol
- tidySymbol :: Symbol -> Symbol
- anfPrefix :: Symbol
- tempPrefix :: Symbol
- vv :: Maybe Integer -> Symbol
- symChars :: HashSet Char
- dummySymbol :: Symbol
- intSymbol :: Show a => Symbol -> a -> Symbol
- tempSymbol :: Symbol -> Integer -> Symbol
- gradIntSymbol :: Integer -> Symbol
- litSymbol :: Symbol -> Symbol
- testSymbol :: Symbol -> Symbol
- renameSymbol :: Symbol -> Int -> Symbol
- kArgSymbol :: Symbol -> Symbol -> Symbol
- existSymbol :: Symbol -> Integer -> Symbol
- suffixSymbol :: Symbol -> Symbol -> Symbol
- mappendSym :: Symbol -> Symbol -> Symbol
- unLitSymbol :: Symbol -> Maybe Symbol
- dummyName :: Symbol
- preludeName :: Symbol
- boolConName :: Symbol
- funConName :: Symbol
- listConName :: Symbol
- listLConName :: Symbol
- tupConName :: Symbol
- setConName :: Symbol
- mapConName :: Symbol
- strConName :: IsString a => a
- charConName :: IsString a => a
- nilName :: Symbol
- consName :: Symbol
- vvName :: Symbol
- size32Name :: Symbol
- size64Name :: Symbol
- bitVecName :: Symbol
- bvAndName :: Symbol
- bvOrName :: Symbol
- propConName :: Symbol
- isPrim :: Symbol -> Bool
- prims :: HashSet Symbol
- mulFuncName :: Symbol
- divFuncName :: Symbol
- setToIntName :: Symbol
- bitVecToIntName :: Symbol
- mapToIntName :: Symbol
- boolToIntName :: IsString a => a
- realToIntName :: Symbol
- toIntName :: Symbol
- setApplyName :: Int -> Symbol
- bitVecApplyName :: Int -> Symbol
- mapApplyName :: Int -> Symbol
- boolApplyName :: Int -> Symbol
- realApplyName :: Int -> Symbol
- intApplyName :: Int -> Symbol
- applyName :: Symbol
- coerceName :: Symbol
- lambdaName :: Symbol
- lamArgSymbol :: Int -> Symbol
- isLamArgSymbol :: Symbol -> Bool
Symbols
Invariant: a SafeText
is made up of:
- '0'..'9'
- ++ ['a'...'z'] ++ ['A'..'Z'] ++
$
If the original text has ANY other chars, it is represented as:
lq$i
where i is a unique integer (for each text)
Instances
class Symbolic a where Source #
Values that can be viewed as Symbols
Instances
Symbolic String Source # | |
Symbolic Text Source # | |
Symbolic Symbol Source # | |
Symbolic DataDecl Source # | |
Symbolic DataCtor Source # | |
Symbolic DataField Source # | |
Symbolic FTycon Source # | |
Symbolic SymConst Source # | String Constants ---------------------------------------------------------- Replace all symbol-representations-of-string-literals with string-literal Used to transform parsed output from fixpoint back into fq. |
Symbolic a => Symbolic (Located a) Source # | |
type LocSymbol = Located Symbol Source #
Located Symbols -----------------------------------------------------
symbolicString :: Symbolic a => a -> String Source #
Conversion to/from Text
symbolSafeText :: Symbol -> SafeText Source #
symbolSafeString :: Symbol -> String Source #
symbolText :: Symbol -> Text Source #
Decoding Symbols -----------------------------------------------------
symbolString :: Symbol -> String Source #
symbolBuilder :: Symbolic a => a -> Builder Source #
isNonSymbol :: Symbol -> Bool Source #
isLitSymbol :: Symbol -> Bool Source #
isTestSymbol :: Symbol -> Bool Source #
isNontrivialVV :: Symbol -> Bool Source #
Destructors
Transforms
tidySymbol :: Symbol -> Symbol Source #
Widely used prefixes
tempPrefix :: Symbol Source #
Creating Symbols
dummySymbol :: Symbol Source #
gradIntSymbol :: Integer -> Symbol Source #
Wrapping Symbols
testSymbol :: Symbol -> Symbol Source #
'testSymbol c' creates the `is-c` symbol for the adt-constructor named c
.
suffixSymbol :: Symbol -> Symbol -> Symbol Source #
Use this **EXCLUSIVELY** when you want to add stuff in front of a Symbol
Unwrapping Symbols
Hardwired global names
preludeName :: Symbol Source #
boolConName :: Symbol Source #
funConName :: Symbol Source #
listConName :: Symbol Source #
tupConName :: Symbol Source #
setConName :: Symbol Source #
mapConName :: Symbol Source #
strConName :: IsString a => a Source #
charConName :: IsString a => a Source #
size32Name :: Symbol Source #
size64Name :: Symbol Source #
bitVecName :: Symbol Source #
propConName :: Symbol Source #
mulFuncName :: Symbol Source #
divFuncName :: Symbol Source #
Casting function names
boolToIntName :: IsString a => a Source #
setApplyName :: Int -> Symbol Source #
bitVecApplyName :: Int -> Symbol Source #
mapApplyName :: Int -> Symbol Source #
boolApplyName :: Int -> Symbol Source #
realApplyName :: Int -> Symbol Source #
intApplyName :: Int -> Symbol Source #
coerceName :: Symbol Source #
lambdaName :: Symbol Source #
lamArgSymbol :: Int -> Symbol Source #
isLamArgSymbol :: Symbol -> Bool Source #
Orphan instances
Data InternedText Source # | Symbols -------------------------------------------------- |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InternedText -> c InternedText # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InternedText # toConstr :: InternedText -> Constr # dataTypeOf :: InternedText -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InternedText) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InternedText) # gmapT :: (forall b. Data b => b -> b) -> InternedText -> InternedText # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InternedText -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InternedText -> r # gmapQ :: (forall d. Data d => d -> u) -> InternedText -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> InternedText -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InternedText -> m InternedText # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InternedText -> m InternedText # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InternedText -> m InternedText # | |
Generic InternedText Source # | |
type Rep InternedText :: Type -> Type # from :: InternedText -> Rep InternedText x # to :: Rep InternedText x -> InternedText # | |
Fixpoint Text Source # | |