# The variables are explained in the file gap/data.g

# name := number;
IF_ghci := 150;


##############################################################################
# Administrative data


IF_SUBPACKAGE_VERSION[IF_ghci] := "dev";

IF_CAS_DESCRIPTION[IF_ghci] :=
[ "GHCi",
"Glasgow Haskell Compiler (GHC): an interactive and batch compilation system for the Haskell 98 language.",
"http://www.haskell.org/ghc/" ];


##############################################################################
# Low level data


IF_EXEC_NAME[IF_ghci] := "ghci";
IF_EXEC_FULL_PATH[IF_ghci] := "/mnt/hda8/costanti/CASes/ghc-6.4.1/bin/i386-unknown-linux/ghci";
IF_EXEC_OPTIONS[IF_ghci] := [];


IF_QUIT_COMMAND[IF_ghci] := ":quit";
IF_DISPLAY_VERSION[IF_ghci] := "";


# IF_FIRST_COMMAND[IF_ghci] := "";
#if not IsBound( IF_PROMPT_NR[IF_ghci] )  then
#    IF_PROMPT_NR[IF_ghci]:= ;
#fi;
IF_FIRST_PROMPT[IF_ghci] := "\nPrelude> ";
IF_PROMPTS[IF_ghci] := [ "\nPrelude> ", "> " ];
IF_FUNC_REMOVE_PROMPT[IF_ghci] := function ( OUT )
    if not '\n' in OUT  then
        return "";
    else
        return OUT{[ 1 .. Position( OUT, '\n' ) - 1 ]};
    fi;
end;
IF_IS_THERE_PROMPT[IF_ghci] := true;


##############################################################################
# High level data


# IF_BRACKETS[IF_ghci] := [ "", "" ]; 
IF_ASSIGN_PREFIX[IF_ghci] := "let"; # 
IF_ASSIGN[IF_ghci] := "="; # "<- return"
IF_END_COMMAND[IF_ghci] := "";
IF_END_COMMAND_NO_OUTPUT[IF_ghci] := "";
IF_FUNC_TYPE[IF_ghci] := function ( name )
    local  type;
    type := IF_LowLevelInterface( IF_ghci, "", ":type ", name );
    return type{[ PositionSublist( type, " :: " ) + 4 .. Length( type ) ]};
end;

IF_TYPE_IS_QUOTED[IF_ghci] := false;

IF_FUNC_DISPLAY[IF_ghci] := "";
# IF_FUNC_DISPLAY_OPENMATH[IF_ghci] := "";

IF_STRING_ARE_QUOTED[IF_ghci] := true;
IF_FUNC_STRING[IF_ghci] := "show";
IF_PROHIBITED_CHARS[IF_ghci] := [  ];


##############################################################################
# data types data


# data types reference


IF_DATA_TYPES[IF_ghci] := rec(


Integer := [
"Integers",
IsInt,
String,
Int
],


Char := [
"Chars",
IsChar,
String,
obj -> obj[2]
],


\[Char\] := [
"Strings",
IsString and IsStringRep,
IF_ParseGapString,
IF_EvalString
],


Bool := [
"Booleans",
obj -> IsBool( obj ) and ( obj = true or obj = false ),
function( obj )
    if obj = true  then
        return "True";
    elif obj = false  then
        return "False";
    fi;
end,
function( obj )
    if obj = "True"  then
        return true;
    elif obj = "False"  then
        return false;
    fi;
end
],


List := [
"lists",
obj -> IsDenseList( obj ) and ForAll( obj, y -> IF_Type(IF_ghci, y) <> fail ),
obj -> IF_ParseGapList( IF_ghci, obj, "[", "]" ),

],




);

