Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Value
- newtype Local = Local {}
- toInt :: MonadError Error m => Value -> m Integer
- toBool :: MonadError Error m => Value -> m Bool
- toList :: MonadError Error m => Value -> m (Vector Value)
- toTuple :: MonadError Error m => Value -> m [Value]
- toIntList :: MonadError Error m => Value -> m (Vector Integer)
- toBoolList :: MonadError Error m => Value -> m (Vector Bool)
- toMatrix :: MonadError Error m => Value -> m (Matrix Integer)
- fromMatrix :: Matrix Integer -> Value
- compareValues :: Value -> Value -> Maybe Ordering
- compareValues' :: Value -> Value -> Ordering
- formatValue :: Value -> String
- readValueIO :: (MonadIO m, MonadError Error m) => IOFormat -> m ([Value], Map String Value)
- writeValueIO :: (MonadError Error m, MonadIO m) => IOFormat -> Map String Value -> Value -> m ()
Documentation
Value
is the values of our restricted Python-like language.
\[ \begin{array}{rl} v ::= & \dots, -2, -1, 0, 1, 2, \dots \\ \vert & \mathbf{false}, \mathbf{true} \\ \vert & \mathbf{nil} \\ \vert & \mathbf{cons}(v, v) \\ \vert & (v, v, \dots, v) \\ \vert & \lambda _ \mu x x \dots x. e \\ \vert & \mathrm{builtin} \\ \end{array} \]
IntVal Integer | |
BoolVal Bool | |
ListVal (Vector Value) | |
TupleVal [Value] | |
ClosureVal Local [(VarName, Type)] [Statement] | |
BuiltinVal Builtin | |
AttributeVal Value Attribute |
toBoolList :: MonadError Error m => Value -> m (Vector Bool) Source #
formatValue :: Value -> String Source #