mondrian.lang(-) : Integer -> Integer;
(-) : Double -> Double;
(-) : Integer -> Integer -> Integer;
(-) : Double -> Double -> Double;
(+) : Integer -> Integer -> Integer;
(+) : Double -> Double -> Double;
(+) : String -> String -> String;
(*) : Integer -> Integer -> Integer;
(*) : Double -> Double -> Double;
(/) : Integer -> Integer -> Integer;
(/) : Double -> Double -> Double;
(%) : Integer -> Integer -> Integer;
(<) : Integer -> Integer -> Boolean;
(<) : Double -> Double -> Boolean;
(>) : Integer -> Integer -> Boolean;
(>) : Double -> Double -> Boolean;
(<=) : Integer -> Integer -> Boolean;
(<=) : Double -> Double -> Boolean;
(>=) : Integer -> Integer -> Boolean;
(>=) : Double -> Double -> Boolean;
(&&) : Boolean -> Boolean -> Boolean;
(||) : Boolean -> Boolean -> Boolean;
(==) : a -> a -> Boolean;
(!=) : a -> a -> Boolean;
All have the usual meanings, + is also string concatenation. (In)equality does the right thing, same value for basic types, object
Equalsmethod for other types.
ord : Character -> Integer;
chr : Integer -> Character;
show : a -> String;
Calls the toString/ToString method on the object.
stringToList : String -> List Character;
listToString : List Character -> String;
As
Stringis an underlying platform type these functions do a complete conversion before returning, you cant have a partially evaluatedString.
arrayToList : Array a -> List a;
listToArray : List a -> Array a;
As
Arrayis an underlying platform type these functions do a complete conversion before returning, you cant have a partially evaluated array.
listToIntArray : List Integer -> Array Int32;
This is a special function for a common case.
listToArraywill return an array of reference values, that is for primitive values such as integers the values will be boxed.listToIntArrayreturns an array of unboxed integers.
class List;
class Nil extends List;
class Cons extends List
{ head : a;
tail : List a;
};
Nilcan also be written[],Consas::, and[a, b, ..., n]has the usual meaning. Though other platform languages can access the fields of aConsthis is unadvisable as they may contain yet-to-be-evaluated values, usehdandtlinmondrian.preludeinstead.
listStringEq : List Char -> String -> Boolean;
Compares whether a list of characters and a string have the same value.
seq : a -> b -> b;
strict : a -> b -> b;
The
seqfunction evaluates its first argument to WHNF and then returns its second argument. Thestrictfunction is similar but evaluates to normal form.
class PatternMathingException extends RuntimeException;
This exception is thrown when a pattern matching error occurs, i.e. when there is no matching
casein aswitch.
evalAndCatch : a -> a -> a;
Evaluates its first argument to normal form and returns it unless an exception occurs in which case it returns its second argument.
bind : IO a -> (a -> IO b) -> IO b;
result : a -> IO a;
The bind function is used by the do expression:
a ; b== bind a (ignore -> b)b <- a ; c== bind a (b -> c)
unsafePerformIO : IO a -> a;
Perform I/O NOW!
createVar : a -> IO (Var a);
setVar : Var a -> a -> IO Void;
getVar : Var a -> IO a;
Create, set and get a variable. Variables can be used to communicate between threads.
class Var
{ Var (Object);
Object getValue();
void setValue(Object);
};
This is the type of variables as seen by other JVM/.NET languages. Other languages should lock a variable before accessing it, and use
wait/notify/notifyAll/pulse/pulseAllas appropriate to synchronize with Mondrian
wait : Var a -> IO Void;
notify : Var a -> IO Void;
notifyAll : Var a -> IO Void;
Same semantics as in JVM/.NET.
ConsoleIn : ReadHandle;
ConsoleOut : WriteHandle;
ConsoleError: WriteHandle;
Standard channels. In .NET a
ReadHandleis aTextReaderand aWriteHandleis aTextWriter.
putChar : Character -> IO Void;
putStr : String -> IO Void;
putStrLn : String -> IO Void;
putLine : IO Void;
putLineoutputs a newline
getChar : IO Character;
getLine : IO String;
openOutputFile : String -> IO WriteHandle;
appendOutputFIle : String -> IO WriteHandle;
openInputFile : String -> IO ReadHandle;
Open files, only text files are supported.
hPutChar : WriteHandle -> Character -> IO Void;
hPutStr : WriteHandle -> String -> IO Void;
hPutStrLn : WriteHandle -> String -> IO Void;
hPutLine : WriteHandle -> IO Void;
hGetChar : ReadHandle -> IO Character;
hGetLine : ReadHandle -> IO String;
fileClose : WriteHandle -> IO Void;
fileClose : ReadHandle -> IO Void;
These are actually the same function... Now you know why we dont have a well defined type system yet!
Last modified: