Portability | portable |
---|---|
Stability | experimental |
Maintainer | github.com/justinethier |
Safe Haskell | Safe-Inferred |
This module contains primitive functions written in Haskell. Most of these map directly to an equivalent Scheme function.
- car :: [LispVal] -> ThrowsError LispVal
- cdr :: [LispVal] -> ThrowsError LispVal
- cons :: [LispVal] -> ThrowsError LispVal
- equal :: [LispVal] -> ThrowsError LispVal
- buildVector :: [LispVal] -> ThrowsError LispVal
- vectorLength :: [LispVal] -> ThrowsError LispVal
- vectorRef :: [LispVal] -> ThrowsError LispVal
- vectorToList :: [LispVal] -> ThrowsError LispVal
- listToVector :: [LispVal] -> ThrowsError LispVal
- makeVector :: [LispVal] -> ThrowsError LispVal
- makeByteVector :: [LispVal] -> ThrowsError LispVal
- byteVector :: [LispVal] -> ThrowsError LispVal
- byteVectorLength :: [LispVal] -> ThrowsError LispVal
- byteVectorRef :: [LispVal] -> ThrowsError LispVal
- byteVectorCopy :: [LispVal] -> ThrowsError LispVal
- byteVectorAppend :: [LispVal] -> ThrowsError LispVal
- byteVectorUtf2Str :: [LispVal] -> ThrowsError LispVal
- byteVectorStr2Utf :: [LispVal] -> ThrowsError LispVal
- hashTblExists :: [LispVal] -> ThrowsError LispVal
- hashTblRef :: [LispVal] -> ThrowsError LispVal
- hashTblSize :: [LispVal] -> ThrowsError LispVal
- hashTbl2List :: [LispVal] -> ThrowsError LispVal
- hashTblKeys :: [LispVal] -> ThrowsError LispVal
- hashTblValues :: [LispVal] -> ThrowsError LispVal
- hashTblCopy :: [LispVal] -> ThrowsError LispVal
- hashTblMake :: [LispVal] -> ThrowsError LispVal
- buildString :: [LispVal] -> ThrowsError LispVal
- makeString :: [LispVal] -> ThrowsError LispVal
- doMakeString :: forall a. (Num a, Eq a) => a -> Char -> String -> LispVal
- stringLength :: [LispVal] -> ThrowsError LispVal
- stringRef :: [LispVal] -> ThrowsError LispVal
- substring :: [LispVal] -> ThrowsError LispVal
- stringCIEquals :: [LispVal] -> ThrowsError LispVal
- stringCIBoolBinop :: ([Char] -> [Char] -> Bool) -> [LispVal] -> ThrowsError LispVal
- stringAppend :: [LispVal] -> ThrowsError LispVal
- stringToNumber :: [LispVal] -> ThrowsError LispVal
- stringToList :: [LispVal] -> ThrowsError LispVal
- listToString :: [LispVal] -> ThrowsError LispVal
- stringCopy :: [LispVal] -> ThrowsError LispVal
- symbol2String :: [LispVal] -> ThrowsError LispVal
- string2Symbol :: [LispVal] -> ThrowsError LispVal
- charCIBoolBinop :: (Char -> Char -> Bool) -> [LispVal] -> ThrowsError LispVal
- charPredicate :: (Char -> Bool) -> [LispVal] -> ThrowsError LispVal
- charUpper :: [LispVal] -> ThrowsError LispVal
- charLower :: [LispVal] -> ThrowsError LispVal
- char2Int :: [LispVal] -> ThrowsError LispVal
- int2Char :: [LispVal] -> ThrowsError LispVal
- isHashTbl :: [LispVal] -> ThrowsError LispVal
- isChar :: [LispVal] -> ThrowsError LispVal
- isString :: [LispVal] -> ThrowsError LispVal
- isBoolean :: [LispVal] -> ThrowsError LispVal
- isDottedList :: [LispVal] -> ThrowsError LispVal
- isProcedure :: [LispVal] -> ThrowsError LispVal
- isList :: LispVal -> ThrowsError LispVal
- isVector :: LispVal -> ThrowsError LispVal
- isByteVector :: LispVal -> ThrowsError LispVal
- isNull :: [LispVal] -> ThrowsError LispVal
- isEOFObject :: [LispVal] -> ThrowsError LispVal
- isSymbol :: [LispVal] -> ThrowsError LispVal
- unpackEquals :: LispVal -> LispVal -> Unpacker -> ThrowsError Bool
- boolBinop :: (LispVal -> ThrowsError a) -> (a -> a -> Bool) -> [LispVal] -> ThrowsError LispVal
- unaryOp :: (LispVal -> ThrowsError LispVal) -> [LispVal] -> ThrowsError LispVal
- strBoolBinop :: (String -> String -> Bool) -> [LispVal] -> ThrowsError LispVal
- charBoolBinop :: (Char -> Char -> Bool) -> [LispVal] -> ThrowsError LispVal
- boolBoolBinop :: (Bool -> Bool -> Bool) -> [LispVal] -> ThrowsError LispVal
- unpackStr :: LispVal -> ThrowsError String
- unpackBool :: LispVal -> ThrowsError Bool
- makePort :: IOMode -> [LispVal] -> IOThrowsError LispVal
- closePort :: [LispVal] -> IOThrowsError LispVal
- currentOutputPort :: [LispVal] -> IOThrowsError LispVal
- currentInputPort :: [LispVal] -> IOThrowsError LispVal
- isOutputPort :: [LispVal] -> IOThrowsError LispVal
- isInputPort :: [LispVal] -> IOThrowsError LispVal
- isCharReady :: [LispVal] -> IOThrowsError LispVal
- readProc :: [LispVal] -> IOThrowsError LispVal
- readCharProc :: (Handle -> IO Char) -> [LispVal] -> IOThrowsError LispVal
- writeProc :: (MonadIO m, MonadError LispError m) => (Handle -> LispVal -> IO a) -> [LispVal] -> m LispVal
- writeCharProc :: [LispVal] -> IOThrowsError LispVal
- readContents :: [LispVal] -> IOThrowsError LispVal
- load :: String -> IOThrowsError [LispVal]
- readAll :: [LispVal] -> IOThrowsError LispVal
- fileExists :: [LispVal] -> IOThrowsError LispVal
- deleteFile :: [LispVal] -> IOThrowsError LispVal
- gensym :: [LispVal] -> IOThrowsError LispVal
- _gensym :: String -> IOThrowsError LispVal
Pure functions
List
car :: [LispVal] -> ThrowsError LispValSource
cdr :: [LispVal] -> ThrowsError LispValSource
cons :: [LispVal] -> ThrowsError LispValSource
equal :: [LispVal] -> ThrowsError LispValSource
Vector
buildVector :: [LispVal] -> ThrowsError LispValSource
vectorLength :: [LispVal] -> ThrowsError LispValSource
vectorRef :: [LispVal] -> ThrowsError LispValSource
vectorToList :: [LispVal] -> ThrowsError LispValSource
listToVector :: [LispVal] -> ThrowsError LispValSource
makeVector :: [LispVal] -> ThrowsError LispValSource
Bytevectors
byteVector :: [LispVal] -> ThrowsError LispValSource
byteVectorRef :: [LispVal] -> ThrowsError LispValSource
Hash Table
hashTblExists :: [LispVal] -> ThrowsError LispValSource
hashTblRef :: [LispVal] -> ThrowsError LispValSource
hashTblSize :: [LispVal] -> ThrowsError LispValSource
hashTbl2List :: [LispVal] -> ThrowsError LispValSource
hashTblKeys :: [LispVal] -> ThrowsError LispValSource
hashTblValues :: [LispVal] -> ThrowsError LispValSource
hashTblCopy :: [LispVal] -> ThrowsError LispValSource
hashTblMake :: [LispVal] -> ThrowsError LispValSource
String
buildString :: [LispVal] -> ThrowsError LispValSource
makeString :: [LispVal] -> ThrowsError LispValSource
stringLength :: [LispVal] -> ThrowsError LispValSource
stringRef :: [LispVal] -> ThrowsError LispValSource
substring :: [LispVal] -> ThrowsError LispValSource
stringCIBoolBinop :: ([Char] -> [Char] -> Bool) -> [LispVal] -> ThrowsError LispValSource
stringAppend :: [LispVal] -> ThrowsError LispValSource
stringToList :: [LispVal] -> ThrowsError LispValSource
listToString :: [LispVal] -> ThrowsError LispValSource
stringCopy :: [LispVal] -> ThrowsError LispValSource
symbol2String :: [LispVal] -> ThrowsError LispValSource
string2Symbol :: [LispVal] -> ThrowsError LispValSource
Character
charCIBoolBinop :: (Char -> Char -> Bool) -> [LispVal] -> ThrowsError LispValSource
charPredicate :: (Char -> Bool) -> [LispVal] -> ThrowsError LispValSource
Determine if given character satisfies the given predicate
charUpper :: [LispVal] -> ThrowsError LispValSource
charLower :: [LispVal] -> ThrowsError LispValSource
char2Int :: [LispVal] -> ThrowsError LispValSource
int2Char :: [LispVal] -> ThrowsError LispValSource
Predicate
isHashTbl :: [LispVal] -> ThrowsError LispValSource
isChar :: [LispVal] -> ThrowsError LispValSource
isString :: [LispVal] -> ThrowsError LispValSource
isBoolean :: [LispVal] -> ThrowsError LispValSource
isDottedList :: [LispVal] -> ThrowsError LispValSource
isProcedure :: [LispVal] -> ThrowsError LispValSource
isNull :: [LispVal] -> ThrowsError LispValSource
isEOFObject :: [LispVal] -> ThrowsError LispValSource
isSymbol :: [LispVal] -> ThrowsError LispValSource
Utility functions
unpackEquals :: LispVal -> LispVal -> Unpacker -> ThrowsError BoolSource
boolBinop :: (LispVal -> ThrowsError a) -> (a -> a -> Bool) -> [LispVal] -> ThrowsError LispValSource
unaryOp :: (LispVal -> ThrowsError LispVal) -> [LispVal] -> ThrowsError LispValSource
strBoolBinop :: (String -> String -> Bool) -> [LispVal] -> ThrowsError LispValSource
charBoolBinop :: (Char -> Char -> Bool) -> [LispVal] -> ThrowsError LispValSource
boolBoolBinop :: (Bool -> Bool -> Bool) -> [LispVal] -> ThrowsError LispValSource
Impure functions
All of these functions must be executed within the IO monad.
Input / Output
closePort :: [LispVal] -> IOThrowsError LispValSource
isInputPort :: [LispVal] -> IOThrowsError LispValSource
isCharReady :: [LispVal] -> IOThrowsError LispValSource
readProc :: [LispVal] -> IOThrowsError LispValSource
readCharProc :: (Handle -> IO Char) -> [LispVal] -> IOThrowsError LispValSource
writeProc :: (MonadIO m, MonadError LispError m) => (Handle -> LispVal -> IO a) -> [LispVal] -> m LispValSource
load :: String -> IOThrowsError [LispVal]Source
readAll :: [LispVal] -> IOThrowsError LispValSource
fileExists :: [LispVal] -> IOThrowsError LispValSource
deleteFile :: [LispVal] -> IOThrowsError LispValSource
Symbol generation
gensym :: [LispVal] -> IOThrowsError LispValSource
Generate a (reasonably) unique symbol, given an optional prefix. This function is provided even though it is not part of R5RS.
_gensym :: String -> IOThrowsError LispValSource
Version of gensym that can be conveniently called from Haskell.