License | MIT |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module contains definitions for Egison internal data.
Synopsis
- data EgisonValue
- = World
- | Char Char
- | String Text
- | Bool Bool
- | ScalarData ScalarData
- | TensorData (Tensor EgisonValue)
- | Float Double
- | InductiveData String [EgisonValue]
- | Tuple [EgisonValue]
- | Collection (Seq EgisonValue)
- | IntHash (HashMap Integer EgisonValue)
- | CharHash (HashMap Char EgisonValue)
- | StrHash (HashMap Text EgisonValue)
- | UserMatcher Env [IPatternDef]
- | Func (Maybe Var) Env [Var] IExpr
- | CFunc Env String IExpr
- | MemoizedFunc (IORef (HashMap [Integer] WHNFData)) Env [String] IExpr
- | PatternFunc Env [String] IPattern
- | PrimitiveFunc PrimitiveFunc
- | LazyPrimitiveFunc LazyPrimitiveFunc
- | IOFunc (EvalM WHNFData)
- | Port Handle
- | RefBox (IORef EgisonValue)
- | Something
- | Undefined
- type Matcher = EgisonValue
- type PrimitiveFunc = [EgisonValue] -> EvalM EgisonValue
- type LazyPrimitiveFunc = [WHNFData] -> EvalM WHNFData
- data EgisonHashKey
- class EgisonData a where
- toEgison :: a -> EgisonValue
- fromEgison :: EgisonValue -> EvalM a
- data Tensor a
- type Shape = [Integer]
- symbolScalarData :: String -> String -> EgisonValue
- symbolScalarData' :: String -> ScalarData
- getSymId :: EgisonValue -> String
- getSymName :: EgisonValue -> String
- mathExprToEgison :: ScalarData -> EgisonValue
- egisonToScalarData :: EgisonValue -> EvalM ScalarData
- extractScalar :: EgisonValue -> EvalM ScalarData
- data Object
- type ObjectRef = IORef Object
- data WHNFData
- data Inner
- data Env = Env [HashMap Var ObjectRef] (Maybe (String, [Index (Maybe ScalarData)]))
- type Binding = (Var, ObjectRef)
- nullEnv :: Env
- extendEnv :: Env -> [Binding] -> Env
- refVar :: Env -> Var -> Maybe ObjectRef
- data EgisonError
- = UnboundVariable String CallStack
- | TypeMismatch String WHNFData CallStack
- | ArgumentsNumPrimitive String Int Int CallStack
- | TupleLength Int Int CallStack
- | InconsistentTensorShape CallStack
- | InconsistentTensorIndex CallStack
- | TensorIndexOutOfBounds Integer Integer CallStack
- | NotImplemented String CallStack
- | Assertion String CallStack
- | Parser String
- | EgisonBug String CallStack
- | MatchFailure CallStack
- | PrimitiveMatchFailure CallStack
- | Default String
- throwErrorWithTrace :: (CallStack -> EgisonError) -> EvalM a
- type EvalM = EvalT RuntimeM
- fromEvalM :: EgisonOpts -> EvalM a -> IO (Either EgisonError a)
- fromEvalT :: EvalM a -> RuntimeM (Either EgisonError a)
Egison values
data EgisonValue Source #
Instances
Eq EgisonValue Source # | |
Defined in Language.Egison.Data (==) :: EgisonValue -> EgisonValue -> Bool # (/=) :: EgisonValue -> EgisonValue -> Bool # | |
Show EgisonValue Source # | |
Defined in Language.Egison.Data showsPrec :: Int -> EgisonValue -> ShowS # show :: EgisonValue -> String # showList :: [EgisonValue] -> ShowS # | |
ToMathExpr EgisonValue Source # | |
Defined in Language.Egison.PrettyMath.AST toMathExpr :: EgisonValue -> MathExpr Source # | |
TensorComponent EgisonValue EgisonValue Source # | |
Defined in Language.Egison.Tensor fromTensor :: Tensor EgisonValue -> EvalM EgisonValue Source # toTensor :: EgisonValue -> EvalM (Tensor EgisonValue) Source # | |
Show (Index EgisonValue) Source # | |
Defined in Language.Egison.Data | |
EgisonData (IORef EgisonValue) Source # | |
Defined in Language.Egison.Data toEgison :: IORef EgisonValue -> EgisonValue Source # fromEgison :: EgisonValue -> EvalM (IORef EgisonValue) Source # |
type Matcher = EgisonValue Source #
type PrimitiveFunc = [EgisonValue] -> EvalM EgisonValue Source #
class EgisonData a where Source #
toEgison :: a -> EgisonValue Source #
fromEgison :: EgisonValue -> EvalM a Source #
Instances
Instances
Show a => Show (Tensor a) Source # | |
ToMathExpr a => ToMathExpr (Tensor a) Source # | |
Defined in Language.Egison.PrettyMath.AST toMathExpr :: Tensor a -> MathExpr Source # |
Scalar
symbolScalarData :: String -> String -> EgisonValue Source #
symbolScalarData' :: String -> ScalarData Source #
getSymId :: EgisonValue -> String Source #
getSymName :: EgisonValue -> String Source #
Internal data
Environment
Errors
data EgisonError Source #
UnboundVariable String CallStack | |
TypeMismatch String WHNFData CallStack | |
ArgumentsNumPrimitive String Int Int CallStack | |
TupleLength Int Int CallStack | |
InconsistentTensorShape CallStack | |
InconsistentTensorIndex CallStack | |
TensorIndexOutOfBounds Integer Integer CallStack | |
NotImplemented String CallStack | |
Assertion String CallStack | |
Parser String | |
EgisonBug String CallStack | |
MatchFailure CallStack | |
PrimitiveMatchFailure CallStack | |
Default String |
Instances
Show EgisonError Source # | |
Defined in Language.Egison.Data showsPrec :: Int -> EgisonError -> ShowS # show :: EgisonError -> String # showList :: [EgisonError] -> ShowS # | |
Exception EgisonError Source # | |
Defined in Language.Egison.Data | |
MonadRuntime EvalM Source # | |
throwErrorWithTrace :: (CallStack -> EgisonError) -> EvalM a Source #
Monads
fromEvalM :: EgisonOpts -> EvalM a -> IO (Either EgisonError a) Source #