Copyright | Justin Ethier |
---|---|
License | MIT (see LICENSE in the distribution) |
Maintainer | github.com/justinethier |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
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
- 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
- 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 :: (MonadError LispError m, MonadIO 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 LispVal Source
cdr :: [LispVal] -> ThrowsError LispVal Source
cons :: [LispVal] -> ThrowsError LispVal Source
equal :: [LispVal] -> ThrowsError LispVal Source
Vector
buildVector :: [LispVal] -> ThrowsError LispVal Source
vectorLength :: [LispVal] -> ThrowsError LispVal Source
vectorRef :: [LispVal] -> ThrowsError LispVal Source
vectorToList :: [LispVal] -> ThrowsError LispVal Source
listToVector :: [LispVal] -> ThrowsError LispVal Source
makeVector :: [LispVal] -> ThrowsError LispVal Source
Hash Table
hashTblExists :: [LispVal] -> ThrowsError LispVal Source
hashTblRef :: [LispVal] -> ThrowsError LispVal Source
hashTblSize :: [LispVal] -> ThrowsError LispVal Source
hashTbl2List :: [LispVal] -> ThrowsError LispVal Source
hashTblKeys :: [LispVal] -> ThrowsError LispVal Source
hashTblValues :: [LispVal] -> ThrowsError LispVal Source
hashTblCopy :: [LispVal] -> ThrowsError LispVal Source
hashTblMake :: [LispVal] -> ThrowsError LispVal Source
String
buildString :: [LispVal] -> ThrowsError LispVal Source
makeString :: [LispVal] -> ThrowsError LispVal Source
stringLength :: [LispVal] -> ThrowsError LispVal Source
stringRef :: [LispVal] -> ThrowsError LispVal Source
substring :: [LispVal] -> ThrowsError LispVal Source
stringCIEquals :: [LispVal] -> ThrowsError LispVal Source
stringCIBoolBinop :: ([Char] -> [Char] -> Bool) -> [LispVal] -> ThrowsError LispVal Source
stringAppend :: [LispVal] -> ThrowsError LispVal Source
stringToNumber :: [LispVal] -> ThrowsError LispVal Source
stringToList :: [LispVal] -> ThrowsError LispVal Source
listToString :: [LispVal] -> ThrowsError LispVal Source
stringCopy :: [LispVal] -> ThrowsError LispVal Source
symbol2String :: [LispVal] -> ThrowsError LispVal Source
string2Symbol :: [LispVal] -> ThrowsError LispVal Source
Character
charCIBoolBinop :: (Char -> Char -> Bool) -> [LispVal] -> ThrowsError LispVal Source
charPredicate :: (Char -> Bool) -> [LispVal] -> ThrowsError LispVal Source
Determine if given character satisfies the given predicate
charUpper :: [LispVal] -> ThrowsError LispVal Source
charLower :: [LispVal] -> ThrowsError LispVal Source
char2Int :: [LispVal] -> ThrowsError LispVal Source
int2Char :: [LispVal] -> ThrowsError LispVal Source
Predicate
isHashTbl :: [LispVal] -> ThrowsError LispVal Source
isChar :: [LispVal] -> ThrowsError LispVal Source
isString :: [LispVal] -> ThrowsError LispVal Source
isBoolean :: [LispVal] -> ThrowsError LispVal Source
isDottedList :: [LispVal] -> ThrowsError LispVal Source
isProcedure :: [LispVal] -> ThrowsError LispVal Source
isList :: LispVal -> ThrowsError LispVal Source
isVector :: LispVal -> ThrowsError LispVal Source
isNull :: [LispVal] -> ThrowsError LispVal Source
isEOFObject :: [LispVal] -> ThrowsError LispVal Source
isSymbol :: [LispVal] -> ThrowsError LispVal Source
Utility functions
unpackEquals :: LispVal -> LispVal -> Unpacker -> ThrowsError Bool Source
boolBinop :: (LispVal -> ThrowsError a) -> (a -> a -> Bool) -> [LispVal] -> ThrowsError LispVal Source
unaryOp :: (LispVal -> ThrowsError LispVal) -> [LispVal] -> ThrowsError LispVal Source
strBoolBinop :: (String -> String -> Bool) -> [LispVal] -> ThrowsError LispVal Source
charBoolBinop :: (Char -> Char -> Bool) -> [LispVal] -> ThrowsError LispVal Source
boolBoolBinop :: (Bool -> Bool -> Bool) -> [LispVal] -> ThrowsError LispVal Source
unpackStr :: LispVal -> ThrowsError String Source
unpackBool :: LispVal -> ThrowsError Bool Source
Impure functions
All of these functions must be executed within the IO monad.
Input / Output
closePort :: [LispVal] -> IOThrowsError LispVal Source
isOutputPort :: [LispVal] -> IOThrowsError LispVal Source
isInputPort :: [LispVal] -> IOThrowsError LispVal Source
isCharReady :: [LispVal] -> IOThrowsError LispVal Source
readProc :: [LispVal] -> IOThrowsError LispVal Source
readCharProc :: (Handle -> IO Char) -> [LispVal] -> IOThrowsError LispVal Source
writeProc :: (MonadError LispError m, MonadIO m) => (Handle -> LispVal -> IO a) -> [LispVal] -> m LispVal Source
writeCharProc :: [LispVal] -> IOThrowsError LispVal Source
readContents :: [LispVal] -> IOThrowsError LispVal Source
load :: String -> IOThrowsError [LispVal] Source
readAll :: [LispVal] -> IOThrowsError LispVal Source
fileExists :: [LispVal] -> IOThrowsError LispVal Source
deleteFile :: [LispVal] -> IOThrowsError LispVal Source
Symbol generation
gensym :: [LispVal] -> IOThrowsError LispVal Source
Generate a (reasonably) unique symbol, given an optional prefix. This function is provided even though it is not part of R5RS.
_gensym :: String -> IOThrowsError LispVal Source
Version of gensym that can be conveniently called from Haskell.