Pugs.AST

|  | Contents | Index
Pugs.AST
Synopsis
type ArrayIndex = Int
class Typeable a => ArrayClass a where
array_iType :: a -> Type
array_fetch :: a -> Eval VArray
array_store :: a -> VArray -> Eval ()
array_fetchKeys :: a -> Eval [ArrayIndex]
array_fetchElem :: a -> ArrayIndex -> Eval (IVar VScalar)
array_storeElem :: a -> ArrayIndex -> IVar VScalar -> Eval ()
array_fetchVal :: a -> ArrayIndex -> Eval Val
array_storeVal :: a -> ArrayIndex -> Val -> Eval ()
array_fetchSize :: a -> Eval ArrayIndex
array_storeSize :: a -> ArrayIndex -> Eval ()
array_extendSize :: a -> ArrayIndex -> Eval ()
array_deleteElem :: a -> ArrayIndex -> Eval ()
array_existsElem :: a -> ArrayIndex -> Eval VBool
array_clear :: a -> Eval ()
array_push :: a -> [Val] -> Eval ()
array_pop :: a -> Eval Val
array_shift :: a -> Eval Val
array_unshift :: a -> [Val] -> Eval ()
array_splice :: a -> ArrayIndex -> ArrayIndex -> [Val] -> Eval [Val]
type Layer = VStr
type FileDescriptor = VInt
class Typeable a => HandleClass a where
handle_iType :: a -> Type
handle_fetch :: a -> Eval VHandle
handle_store :: a -> VHandle -> Eval ()
handle_write :: a -> VStr -> Eval VInt
handle_print :: a -> [Val] -> Eval VBool
handle_printf :: a -> VStr -> [Val] -> Eval VBool
handle_read :: a -> VInt -> Eval (VInt, VStr)
handle_readLine :: a -> Eval VStr
handle_getC :: a -> Eval VStr
handle_close :: a -> Eval ()
handle_binmode :: a -> Layer -> Eval ()
handle_open :: a -> Layer -> FilePath -> Eval VBool
handle_eof :: a -> Eval VBool
handle_fileNo :: a -> Eval FileDescriptor
handle_seek :: a -> VInt -> SeekMode -> Eval VBool
handle_tell :: a -> Eval VInt
type HashIndex = VStr
class Typeable a => HashClass a where
hash_iType :: a -> Type
hash_fetch :: a -> Eval VHash
hash_store :: a -> VHash -> Eval ()
hash_fetchElem :: a -> HashIndex -> Eval (IVar VScalar)
hash_storeElem :: a -> HashIndex -> IVar VScalar -> Eval ()
hash_fetchVal :: a -> HashIndex -> Eval Val
hash_storeVal :: a -> HashIndex -> Val -> Eval ()
hash_fetchKeys :: a -> Eval [HashIndex]
hash_deleteElem :: a -> HashIndex -> Eval ()
hash_existsElem :: a -> HashIndex -> Eval VBool
hash_clear :: a -> Eval ()
hash_isEmpty :: a -> Eval VBool
class Typeable a => ScalarClass a where
scalar_iType :: a -> Type
scalar_fetch :: a -> Eval VScalar
scalar_store :: a -> VScalar -> Eval ()
scalar_const :: a -> Maybe VScalar
class Typeable a => CodeClass a where
code_iType :: a -> Type
code_fetch :: a -> Eval VCode
code_store :: a -> VCode -> Eval ()
code_assuming :: a -> [Exp] -> [Exp] -> Eval VCode
code_apply :: a -> Eval Val
code_assoc :: a -> VStr
code_params :: a -> Params
class Typeable a => ThunkClass a where
thunk_iType :: a -> Type
thunk_force :: a -> Eval Val
class Typeable a => RuleClass a where
rule_iType :: a -> Type
rule_fetch :: a -> Eval VRule
rule_store :: a -> VRule -> Eval ()
rule_match :: a -> VStr -> Eval (MatchResult Val)
class Typeable a => PairClass a where
pair_iType :: a -> Type
pair_fetch :: a -> Eval VPair
pair_fetchKey :: a -> Eval VScalar
pair_fetchVal :: a -> Eval VScalar
pair_storeVal :: a -> Val -> Eval ()
pair_fetchElem :: a -> Eval (IVar VScalar)
class Typeable a => ObjectClass a where
object_iType :: a -> Type
type Ident = String
errIndex :: Show a => Maybe b -> a -> Eval b
getIndex :: Int -> Maybe a -> Eval [a] -> Maybe (Eval b) -> Eval a
ifValTypeIsa :: Val -> String -> Eval a -> Eval a -> Eval a
ifListContext :: MonadReader Env m => m t -> m t -> m t
retEmpty :: Eval Val
evalValType :: Val -> Eval Type
fromVal' :: Value a => Val -> Eval a
class (Typeable n, Show n, Ord n) => Value n where
fromVal :: Val -> Eval n
vCast :: Val -> n
castV :: n -> Val
doCast :: Val -> n
fmapVal :: (n -> n) -> Val -> Val
castFailM :: (Show a, Typeable b) => a -> Eval b
castFail :: (Show a, Typeable b) => a -> b
juncToBool :: VJunc -> Bool
showNum :: Show a => a -> String
valToStr :: Val -> Eval VStr
type VScalar = Val
strRangeInf :: String -> [String]
strRange :: String -> String -> [String]
strInc :: String -> String
charInc :: Char -> Char
intCast :: Num b => Val -> b
type VList = [Val]
type VSubst = (VRule, Exp)
type VArray = [Val]
type VHash = Map VStr Val
newtype VThunk = MkThunk (Eval Val)
newtype VProcess = MkProcess ProcessHandle
type VPair = (Val, Val)
data Val
= VUndef
| VBool !VBool
| VInt !VInt
| VRat !VRat
| VNum !VNum
| VComplex !VComplex
| VStr !VStr
| VList VList
| VRef !VRef
| VCode !VCode
| VBlock !VBlock
| VJunc !VJunc
| VError !VStr !Exp
| VHandle !VHandle
| VSocket !VSocket
| VThread !VThread
| VProcess !VProcess
| VRule !VRule
| VSubst !VSubst
| VControl !VControl
| VOpaque !VOpaque
valType :: Val -> Type
type VBlock = Exp
data VControl
= ControlLeave !(Env -> Eval Bool) !Val
| ControlExit !ExitCode
| ControlEnv !Env
data VJunc = Junc {
juncType :: !JuncType
juncDup :: !(Set Val)
juncSet :: !(Set Val)
}
data JuncType
= JAny
| JAll
| JNone
| JOne
data SubType
= SubMethod
| SubRoutine
| SubBlock
| SubPrim
isSlurpy :: Param -> Bool
data Param = MkParam {
isInvocant :: !Bool
isOptional :: !Bool
isNamed :: !Bool
isLValue :: !Bool
isWritable :: !Bool
isLazy :: !Bool
paramName :: !String
paramContext :: !Cxt
paramDefault :: !Exp
}
type Params = [Param]
type Bindings = [(Param, Exp)]
type SlurpLimit = [(VInt, Exp)]
data VCode = MkCode {
isMulti :: !Bool
subName :: !String
subType :: !SubType
subPad :: !Pad
subAssoc :: !String
subParams :: !Params
subBindings :: !Bindings
subSlurpLimit :: !SlurpLimit
subReturns :: !Type
subBody :: !Exp
}
mkPrim :: VCode
mkSub :: VCode
data Pos = MkPos {
posName :: !String
posBeginLine :: !Int
posBeginColumn :: !Int
posEndLine :: !Int
posEndColumn :: !Int
}
data Exp
= Noop
| App !String ![Exp] ![Exp]
| Syn !String ![Exp]
| Cxt !Cxt !Exp
| Pos !Pos !Exp
| Pad !Scope !Pad !Exp
| Sym !Scope !Var !Exp
| Stmts !Exp !Exp
| Prim !([Val] -> Eval Val)
| Val !Val
| Var !Var
| Parens !Exp
| NonTerm !Pos
class Unwrap a where
unwrap :: a -> a
fromVals :: Value n => Val -> Eval [n]
extractExp :: Exp -> ([Exp], [String]) -> ([Exp], [String])
extract :: Exp -> [String] -> (Exp, [String])
cxtOfSigil :: Char -> Cxt
typeOfSigil :: Char -> Type
buildParam :: String -> String -> String -> Exp -> Param
defaultArrayParam :: Param
defaultHashParam :: Param
defaultScalarParam :: Param
type DebugInfo = Maybe (TVar (Map String String))
data Env = Env {
envContext :: !Cxt
envLValue :: !Bool
envLexical :: !Pad
envGlobal :: !(TVar Pad)
envClasses :: !ClassTree
envEval :: !(Exp -> Eval Val)
envCaller :: !(Maybe Env)
envBody :: !Exp
envDepth :: !Int
envID :: !Unique
envDebug :: !DebugInfo
envStash :: !String
envPos :: !Pos
}
envWant :: Env -> String
data Pad = MkPad !(Map Var [(TVar Bool, TVar VRef)])
mkPad :: [(Var, [(TVar Bool, TVar VRef)])] -> Pad
lookupPad :: Var -> Pad -> Maybe [TVar VRef]
padToList :: Pad -> [(Var, [(TVar Bool, TVar VRef)])]
diffPads :: Pad -> Pad -> Pad
unionPads :: Pad -> Pad -> Pad
genMultiSym :: MonadSTM m => String -> VRef -> m (Pad -> Pad)
genSym :: MonadSTM m => String -> VRef -> m (Pad -> Pad)
show' :: Show a => a -> String
data Scope
= SGlobal
| SMy
| SOur
| SLet
| STemp
| SState
type Eval x = EvalT (ContT Val (ReaderT Env SIO)) x
type EvalMonad = EvalT (ContT Val (ReaderT Env SIO))
newtype EvalT m a = EvalT {
runEvalT :: (m a)
}
data SIO a
= MkSTM !(STM a)
| MkIO !(IO a)
| MkSIO !a
runSTM :: SIO a -> STM a
runIO :: SIO a -> IO a
runEvalSTM :: Env -> Eval Val -> STM Val
runEvalIO :: Env -> Eval Val -> IO Val
shiftT :: ((a -> Eval Val) -> Eval Val) -> Eval a
resetT :: Eval Val -> Eval Val
class Monad m => MonadSTM m where
liftSTM :: STM a -> m a
runEvalMain :: Env -> Eval Val -> IO Val
findSymRef :: MonadSTM m => String -> Pad -> m VRef
findSym :: String -> Pad -> Maybe (TVar VRef)
class (MonadReader Env m, MonadCont m, MonadIO m, MonadSTM m) => MonadEval m where
askGlobal :: Eval Pad
writeVar :: Var -> Val -> Eval ()
readVar :: Var -> Eval Val
emptyExp :: Exp
retControl :: VControl -> Eval a
retError :: Show a => VStr -> a -> Eval b
naturalOrRat :: GenParser Char st (Either Integer (Ratio Integer))
evalExp :: Exp -> Eval Val
defined :: VScalar -> Bool
undef :: VScalar
forceRef :: VRef -> Eval Val
dumpRef :: VRef -> Eval Val
readRef :: VRef -> Eval Val
retIVar :: Typeable a => IVar a -> Eval Val
writeRef :: VRef -> Val -> Eval ()
clearRef :: VRef -> Eval ()
newObject :: MonadSTM m => Type -> m VRef
doPair :: Val -> (forall a . PairClass a => a -> b) -> Eval b
doHash :: Val -> (forall a . HashClass a => a -> b) -> Eval b
doArray :: Val -> (forall a . ArrayClass a => a -> b) -> Eval b
readIVar :: IVar v -> Eval v
writeIVar :: IVar v -> v -> Eval ()
refType :: VRef -> Type
scalarRef :: ScalarClass a => a -> VRef
codeRef :: CodeClass a => a -> VRef
arrayRef :: ArrayClass a => a -> VRef
hashRef :: HashClass a => a -> VRef
thunkRef :: ThunkClass a => a -> VRef
pairRef :: PairClass a => a -> VRef
newScalar :: MonadSTM m => VScalar -> m (IVar VScalar)
newArray :: MonadSTM m => VArray -> m (IVar VArray)
newHandle :: MonadSTM m => VHandle -> m (IVar VHandle)
proxyScalar :: Eval VScalar -> (VScalar -> Eval ()) -> IVar VScalar
constScalar :: VScalar -> IVar VScalar
lazyScalar :: VScalar -> IVar VScalar
lazyUndef :: IVar VScalar
constArray :: VArray -> IVar VArray
retConstError :: VScalar -> Eval b
Documentation
type ArrayIndex = Int
class Typeable a => ArrayClass a where
Methods
array_iType :: a -> Type
array_fetch :: a -> Eval VArray
array_store :: a -> VArray -> Eval ()
array_fetchKeys :: a -> Eval [ArrayIndex]
array_fetchElem :: a -> ArrayIndex -> Eval (IVar VScalar)
array_storeElem :: a -> ArrayIndex -> IVar VScalar -> Eval ()
array_fetchVal :: a -> ArrayIndex -> Eval Val
array_storeVal :: a -> ArrayIndex -> Val -> Eval ()
array_fetchSize :: a -> Eval ArrayIndex
array_storeSize :: a -> ArrayIndex -> Eval ()
array_extendSize :: a -> ArrayIndex -> Eval ()
array_deleteElem :: a -> ArrayIndex -> Eval ()
array_existsElem :: a -> ArrayIndex -> Eval VBool
array_clear :: a -> Eval ()
array_push :: a -> [Val] -> Eval ()
array_pop :: a -> Eval Val
array_shift :: a -> Eval Val
array_unshift :: a -> [Val] -> Eval ()
array_splice :: a -> ArrayIndex -> ArrayIndex -> [Val] -> Eval [Val]
Instances
ArrayClass IArraySlice
ArrayClass IArray
ArrayClass VArray
ArrayClass (IVar VPair)
type Layer = VStr
type FileDescriptor = VInt
class Typeable a => HandleClass a where
Methods
handle_iType :: a -> Type
handle_fetch :: a -> Eval VHandle
handle_store :: a -> VHandle -> Eval ()
handle_write :: a -> VStr -> Eval VInt
handle_print :: a -> [Val] -> Eval VBool
handle_printf :: a -> VStr -> [Val] -> Eval VBool
handle_read :: a -> VInt -> Eval (VInt, VStr)
handle_readLine :: a -> Eval VStr
handle_getC :: a -> Eval VStr
handle_close :: a -> Eval ()
handle_binmode :: a -> Layer -> Eval ()
handle_open :: a -> Layer -> FilePath -> Eval VBool
handle_eof :: a -> Eval VBool
handle_fileNo :: a -> Eval FileDescriptor
handle_seek :: a -> VInt -> SeekMode -> Eval VBool
handle_tell :: a -> Eval VInt
Instances
HandleClass IHandle
type HashIndex = VStr
class Typeable a => HashClass a where
Methods
hash_iType :: a -> Type
hash_fetch :: a -> Eval VHash
hash_store :: a -> VHash -> Eval ()
hash_fetchElem :: a -> HashIndex -> Eval (IVar VScalar)
hash_storeElem :: a -> HashIndex -> IVar VScalar -> Eval ()
hash_fetchVal :: a -> HashIndex -> Eval Val
hash_storeVal :: a -> HashIndex -> Val -> Eval ()
hash_fetchKeys :: a -> Eval [HashIndex]
hash_deleteElem :: a -> HashIndex -> Eval ()
hash_existsElem :: a -> HashIndex -> Eval VBool
hash_clear :: a -> Eval ()
hash_isEmpty :: a -> Eval VBool
Instances
HashClass (IVar VPair)
HashClass VHash
HashClass IHashEnv
HashClass IHash
class Typeable a => ScalarClass a where
Methods
scalar_iType :: a -> Type
scalar_fetch :: a -> Eval VScalar
scalar_store :: a -> VScalar -> Eval ()
scalar_const :: a -> Maybe VScalar
Instances
ScalarClass IScalarProxy
ScalarClass IScalar
ScalarClass IScalarLazy
ScalarClass IScalarCwd
ScalarClass VScalar
class Typeable a => CodeClass a where
Methods
code_iType :: a -> Type
code_fetch :: a -> Eval VCode
code_store :: a -> VCode -> Eval ()
code_assuming :: a -> [Exp] -> [Exp] -> Eval VCode
code_apply :: a -> Eval Val
code_assoc :: a -> VStr
code_params :: a -> Params
Instances
CodeClass ICode
CodeClass VCode
class Typeable a => ThunkClass a where
Methods
thunk_iType :: a -> Type
thunk_force :: a -> Eval Val
Instances
ThunkClass VThunk
class Typeable a => RuleClass a where
Methods
rule_iType :: a -> Type
rule_fetch :: a -> Eval VRule
rule_store :: a -> VRule -> Eval ()
rule_match :: a -> VStr -> Eval (MatchResult Val)
Instances
class Typeable a => PairClass a where
Methods
pair_iType :: a -> Type
pair_fetch :: a -> Eval VPair
pair_fetchKey :: a -> Eval VScalar
pair_fetchVal :: a -> Eval VScalar
pair_storeVal :: a -> Val -> Eval ()
pair_fetchElem :: a -> Eval (IVar VScalar)
Instances
PairClass VPair
PairClass IPairHashSlice
class Typeable a => ObjectClass a where
Methods
object_iType :: a -> Type
Instances
Typeable a => ObjectClass (IVar a)
type Ident = String
errIndex :: Show a => Maybe b -> a -> Eval b
getIndex :: Int -> Maybe a -> Eval [a] -> Maybe (Eval b) -> Eval a
ifValTypeIsa :: Val -> String -> Eval a -> Eval a -> Eval a
ifListContext :: MonadReader Env m => m t -> m t -> m t
retEmpty :: Eval Val
evalValType :: Val -> Eval Type
fromVal' :: Value a => Val -> Eval a
class (Typeable n, Show n, Ord n) => Value n where
Methods
fromVal :: Val -> Eval n
vCast :: Val -> n
castV :: n -> Val
doCast :: Val -> n
fmapVal :: (n -> n) -> Val -> Val
Instances
Value (IVar VScalar)
Value VRef
Value [Int]
Value [VStr]
Value VPair
Value [(VStr, Val)]
Value VHash
Value [VPair]
Value VCode
Value VBool
Value VInt
Value VRat
Value VNum
Value VComplex
Value VStr
Value VList
Value VHandle
Value VSocket
Value VThread
Value VProcess
Value Int
Value Word
Value Word8
Value [Word8]
Value VScalar
castFailM :: (Show a, Typeable b) => a -> Eval b
castFail :: (Show a, Typeable b) => a -> b
juncToBool :: VJunc -> Bool
showNum :: Show a => a -> String
valToStr :: Val -> Eval VStr
type VScalar = Val
strRangeInf :: String -> [String]
strRange :: String -> String -> [String]
strInc :: String -> String
charInc :: Char -> Char
intCast :: Num b => Val -> b
type VList = [Val]
type VSubst = (VRule, Exp)
type VArray = [Val]
type VHash = Map VStr Val
newtype VThunk
Constructors
MkThunk (Eval Val) |
Instances
ThunkClass VThunk
Show VThunk
Eq VThunk
Ord VThunk
Typeable VThunk
newtype VProcess
Constructors
MkProcess ProcessHandle |
Instances
Value VProcess
Show VProcess
Eq VProcess
Ord VProcess
Typeable VProcess
type VPair = (Val, Val)
data Val
Constructors
VUndef |
VBool !VBool |
VInt !VInt |
VRat !VRat |
VNum !VNum |
VComplex !VComplex |
VStr !VStr |
VList VList |
VRef !VRef |
VCode !VCode |
VBlock !VBlock |
VJunc !VJunc |
VError !VStr !Exp |
VHandle !VHandle |
VSocket !VSocket |
VThread !VThread |
VProcess !VProcess |
VRule !VRule |
VSubst !VSubst |
VControl !VControl |
VOpaque !VOpaque |
Instances
Value [(VStr, Val)]
Show Val
Eq Val
Ord Val
Typeable Val
Pretty (Val, Val)
Pretty (Val, Val)
Pretty Val
valType :: Val -> Type
type VBlock = Exp
data VControl
Constructors
ControlLeave !(Env -> Eval Bool) !Val |
ControlExit !ExitCode |
ControlEnv !Env |
Instances
Show VControl
Eq VControl
Ord VControl
data VJunc
Constructors
Junc |
juncType :: !JuncType |
juncDup :: !(Set Val) |
juncSet :: !(Set Val) |
Instances
Show VJunc
Eq VJunc
Ord VJunc
data JuncType
Constructors
JAny |
JAll |
JNone |
JOne |
Instances
Show JuncType
Eq JuncType
Ord JuncType
data SubType
Constructors
SubMethod |
SubRoutine |
SubBlock |
SubPrim |
Instances
Show SubType
Eq SubType
Ord SubType
isSlurpy :: Param -> Bool
data Param
Constructors
MkParam |
isInvocant :: !Bool |
isOptional :: !Bool |
isNamed :: !Bool |
isLValue :: !Bool |
isWritable :: !Bool |
isLazy :: !Bool |
paramName :: !String |
paramContext :: !Cxt |
paramDefault :: !Exp |
Instances
Show Param
Eq Param
Ord Param
Compile Param
type Params = [Param]
type Bindings = [(Param, Exp)]
type SlurpLimit = [(VInt, Exp)]
data VCode
Constructors
MkCode |
isMulti :: !Bool |
subName :: !String |
subType :: !SubType |
subPad :: !Pad |
subAssoc :: !String |
subParams :: !Params |
subBindings :: !Bindings |
subSlurpLimit :: !SlurpLimit |
subReturns :: !Type |
subBody :: !Exp |
Instances
CodeClass VCode
Value VCode
Show VCode
Eq VCode
Ord VCode
Typeable VCode
Compile VCode
mkPrim :: VCode
mkSub :: VCode
data Pos
Constructors
MkPos |
posName :: !String |
posBeginLine :: !Int |
posBeginColumn :: !Int |
posEndLine :: !Int |
posEndColumn :: !Int |
Instances
Show Pos
Eq Pos
Ord Pos
Typeable Pos
Compile Pos
Pretty Pos
data Exp
Constructors
Noop | No-op
App !String ![Exp] ![Exp] | Function application
Syn !String ![Exp] | Syntax
Cxt !Cxt !Exp | Context
Pos !Pos !Exp | Position
Pad !Scope !Pad !Exp | Lexical pad
Sym !Scope !Var !Exp | Symbol
Stmts !Exp !Exp | Statements
Prim !([Val] -> Eval Val) | Primitive
Val !Val | Value
Var !Var | Variable
Parens !Exp | Parentheses (not usually used)
NonTerm !Pos | Parse error
Instances
Unwrap [Exp]
Unwrap Exp
Show Exp
Eq Exp
Ord Exp
Typeable Exp
Compile Exp
Compile Exp
Pretty Exp
Pretty (Exp, SourcePos)
class Unwrap a where
Methods
unwrap :: a -> a
Instances
Unwrap [Exp]
Unwrap Exp
fromVals :: Value n => Val -> Eval [n]
extractExp :: Exp -> ([Exp], [String]) -> ([Exp], [String])
extract :: Exp -> [String] -> (Exp, [String])
cxtOfSigil :: Char -> Cxt
typeOfSigil :: Char -> Type
buildParam :: String -> String -> String -> Exp -> Param
defaultArrayParam :: Param
defaultHashParam :: Param
defaultScalarParam :: Param
type DebugInfo = Maybe (TVar (Map String String))
data Env
Environment
Constructors
Env |
envContext :: !Cxt | Current context
envLValue :: !Bool | LValue context?
envLexical :: !Pad | Lexical pad
envGlobal :: !(TVar Pad) | Global pad
envClasses :: !ClassTree | Current class tree
envEval :: !(Exp -> Eval Val) | Active evaluator
envCaller :: !(Maybe Env) | Caller's env
envBody :: !Exp | Current AST
envDepth :: !Int | Recursion depth
envID :: !Unique | Unique ID of Env
envDebug :: !DebugInfo | Debug info map
envStash :: !String | Misc. stash
envPos :: !Pos | Source position range
Instances
MonadReader Env EvalMonad
Show Env
Eq Env
Ord Env
Pretty Env
envWant :: Env -> String
data Pad
Constructors
MkPad !(Map Var [(TVar Bool, TVar VRef)]) |
Instances
Show Pad
Eq Pad
Ord Pad
Typeable Pad
Compile Pad
Compile Pad
Pretty Pad
mkPad :: [(Var, [(TVar Bool, TVar VRef)])] -> Pad
lookupPad :: Var -> Pad -> Maybe [TVar VRef]
padToList :: Pad -> [(Var, [(TVar Bool, TVar VRef)])]
diffPads :: Pad -> Pad -> Pad
unionPads :: Pad -> Pad -> Pad
genMultiSym :: MonadSTM m => String -> VRef -> m (Pad -> Pad)
genSym :: MonadSTM m => String -> VRef -> m (Pad -> Pad)
show' :: Show a => a -> String
data Scope
Constructors
SGlobal |
SMy |
SOur |
SLet |
STemp |
SState |
Instances
Show Scope
Eq Scope
Ord Scope
Read Scope
Enum Scope
type Eval x = EvalT (ContT Val (ReaderT Env SIO)) x
type EvalMonad = EvalT (ContT Val (ReaderT Env SIO))
newtype EvalT m a
Constructors
EvalT |
runEvalT :: (m a) |
Instances
MonadTrans EvalT
data SIO a
Constructors
MkSTM !(STM a) |
MkIO !(IO a) |
MkSIO !a |
Instances
Monad SIO
MonadIO SIO
MonadSTM SIO
(Typeable a, ??? a) => Typeable (SIO a)
runSTM :: SIO a -> STM a
runIO :: SIO a -> IO a
runEvalSTM :: Env -> Eval Val -> STM Val
runEvalIO :: Env -> Eval Val -> IO Val
shiftT :: ((a -> Eval Val) -> Eval Val) -> Eval a
resetT :: Eval Val -> Eval Val
class Monad m => MonadSTM m where
Methods
liftSTM :: STM a -> m a
Instances
MonadSTM EvalMonad
MonadSTM STM
MonadSTM IO
MonadSTM SIO
runEvalMain :: Env -> Eval Val -> IO Val
findSymRef :: MonadSTM m => String -> Pad -> m VRef
findSym :: String -> Pad -> Maybe (TVar VRef)
class (MonadReader Env m, MonadCont m, MonadIO m, MonadSTM m) => MonadEval m where
Methods
askGlobal :: Eval Pad
writeVar :: Var -> Val -> Eval ()
readVar :: Var -> Eval Val
emptyExp :: Exp
retControl :: VControl -> Eval a
retError :: Show a => VStr -> a -> Eval b
naturalOrRat :: GenParser Char st (Either Integer (Ratio Integer))
evalExp :: Exp -> Eval Val
defined :: VScalar -> Bool
undef :: VScalar
forceRef :: VRef -> Eval Val
dumpRef :: VRef -> Eval Val
readRef :: VRef -> Eval Val
retIVar :: Typeable a => IVar a -> Eval Val
writeRef :: VRef -> Val -> Eval ()
clearRef :: VRef -> Eval ()
newObject :: MonadSTM m => Type -> m VRef
doPair :: Val -> (forall a . PairClass a => a -> b) -> Eval b
doHash :: Val -> (forall a . HashClass a => a -> b) -> Eval b
doArray :: Val -> (forall a . ArrayClass a => a -> b) -> Eval b
readIVar :: IVar v -> Eval v
writeIVar :: IVar v -> v -> Eval ()
refType :: VRef -> Type
scalarRef :: ScalarClass a => a -> VRef
codeRef :: CodeClass a => a -> VRef
arrayRef :: ArrayClass a => a -> VRef
hashRef :: HashClass a => a -> VRef
thunkRef :: ThunkClass a => a -> VRef
pairRef :: PairClass a => a -> VRef
newScalar :: MonadSTM m => VScalar -> m (IVar VScalar)
newArray :: MonadSTM m => VArray -> m (IVar VArray)
newHandle :: MonadSTM m => VHandle -> m (IVar VHandle)
proxyScalar :: Eval VScalar -> (VScalar -> Eval ()) -> IVar VScalar
constScalar :: VScalar -> IVar VScalar
lazyScalar :: VScalar -> IVar VScalar
lazyUndef :: IVar VScalar
constArray :: VArray -> IVar VArray
retConstError :: VScalar -> Eval b
Instances
MonadEval EvalMonad
Produced by Haddock version ADDOCK_VERSION