LicenseGPL-3
Maintainerjaredforthdev@gmail.com
Stabilityexperimental
Safe HaskellSafe

Scheme.Primitives

Description

 

Synopsis

Documentation

primitiveBindings :: IO Env #

Bind to primitive values when the program starts

primitives :: [(String, [LispVal] -> ThrowsError LispVal)] #

Define the list of primitives that are supported

ioPrimitives :: [(String, [LispVal] -> IOThrowsError LispVal)] #

IO primitives

numericBinop :: (Integer -> Integer -> Integer) -> [LispVal] -> ThrowsError LispVal #

Take a primitive Haskell function and wrap it with code to unpack args, apply a function, and wrap the result in Number constructor

boolBinop :: (LispVal -> ThrowsError a) -> (a -> a -> Bool) -> [LispVal] -> ThrowsError LispVal #

Take two arguments and return a boolean

numBoolBinop :: (Integer -> Integer -> Bool) -> [LispVal] -> ThrowsError LispVal #

Specialize boolBinop for integers

strBoolBinop :: (String -> String -> Bool) -> [LispVal] -> ThrowsError LispVal #

Specialize boolBinop for strings

boolBoolBinop :: (Bool -> Bool -> Bool) -> [LispVal] -> ThrowsError LispVal #

Specialize boolBinop for booleans

unpackStr :: LispVal -> ThrowsError String #

Unpack strings from LispVal

unpackBool :: LispVal -> ThrowsError Bool #

Unpack booleans from LispVal

unpackNum :: LispVal -> ThrowsError Integer #

Unpack numbers from LispVal

car :: [LispVal] -> ThrowsError LispVal #

The car list primitive

cdr :: [LispVal] -> ThrowsError LispVal #

The cdr list primitive

cons :: [LispVal] -> ThrowsError LispVal #

The cons list primitive

eqv :: [LispVal] -> ThrowsError LispVal #

The eqv equivalence predicate

data Unpacker #

Data type that can hold a function for any `LispVal -> x` where x supports equality

Constructors

Eq a => AnyUnpacker (LispVal -> ThrowsError a) 

unpackEquals :: LispVal -> LispVal -> Unpacker -> ThrowsError Bool #

Helper function tha takes and Unpacker and determines if two LispVal are equal

equal :: [LispVal] -> ThrowsError LispVal #

Define `equal?` with helper functions

applyProc :: [LispVal] -> IOThrowsError LispVal #

Wrapper around apply. This destructures the argument list into the proper form

makePort :: IOMode -> [LispVal] -> IOThrowsError LispVal #

Wrap the openFile Haskell function

closePort :: [LispVal] -> IOThrowsError LispVal #

Wrap the hClose Haskell function

readProc :: [LispVal] -> IOThrowsError LispVal #

wraps the Haskell hGetLine and sends the result to parseExpr, to be turned into a LispVal

writeProc :: [LispVal] -> IOThrowsError LispVal #

Convert LispVal to a string and write to specified port

readContents :: [LispVal] -> IOThrowsError LispVal #

Read a file into a string in memory. This is a wrapper around the readFile Haskell function.

readAll :: [LispVal] -> IOThrowsError LispVal #

Wrap load return value with List constructor