Portability | portable |
---|---|
Stability | experimental |
Maintainer | github.com/justinethier |
Safe Haskell | Safe-Inferred |
Language.Scheme.Core
Description
This module contains Core functionality, primarily Scheme expression evaluation.
- evalLisp :: Env -> LispVal -> IOThrowsError LispVal
- evalLisp' :: Env -> LispVal -> IO (ThrowsError LispVal)
- evalString :: Env -> String -> IO String
- evalAndPrint :: Env -> String -> IO ()
- apply :: LispVal -> LispVal -> [LispVal] -> IOThrowsError LispVal
- continueEval :: Env -> LispVal -> LispVal -> IOThrowsError LispVal
- primitiveBindings :: IO Env
- r5rsEnv :: IO Env
- version :: String
- getDataFileFullPath :: String -> IO String
- registerExtensions :: Env -> (FilePath -> IO FilePath) -> IO ()
- showBanner :: IO ()
- substr :: (LispVal, LispVal, LispVal) -> IOThrowsError LispVal
- updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
- updateByteVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
Scheme code evaluation
evalLisp :: Env -> LispVal -> IOThrowsError LispValSource
Evaluate a lisp data structure and return a value for use by husk
evalAndPrint :: Env -> String -> IO ()Source
Evaluate a string and print results to console
Arguments
:: LispVal | Current continuation |
-> LispVal | Function or continuation to execute |
-> [LispVal] | Arguments |
-> IOThrowsError LispVal | Final value of computation |
Call into a Scheme function
Arguments
:: Env | Current environment |
-> LispVal | Current continuation |
-> LispVal | Value of previous computation |
-> IOThrowsError LispVal | Final value of computation |
A support function for eval; eval calls into this function instead of returning values directly. continueEval then uses the continuation argument to manage program control flow.
Core data
primitiveBindings :: IO EnvSource
Environment containing the primitive forms that are built into the Scheme language. This function only includes forms that are implemented in Haskell; derived forms implemented in Scheme (such as let, list, etc) are available in the standard library which must be pulled into the environment using (load)
For the purposes of using husk as an extension language, r5rsEnv will probably be more useful.
Utility functions
getDataFileFullPath :: String -> IO StringSource
Get the full path to a data file installed for husk
registerExtensions :: Env -> (FilePath -> IO FilePath) -> IO ()Source
Register optional SRFI extensions
showBanner :: IO ()Source
A utility function to display the husk console banner
substr :: (LispVal, LispVal, LispVal) -> IOThrowsError LispValSource
A helper function for the special form (string-set!)
updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispValSource
A helper function for the special form (vector-set!)
updateByteVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispValSource
A helper function for the special form (bytevector-u8-set!)