Cellme
{ code : String
, prog : Result String (List (Schelme.EvalStep.Term cs))
, runstate : RunState id cs
}
a cell is a text-form schelme program, the compiled version of same, and the program's RunState.
{ getCell : id -> CellContainer id cc -> Maybe (Cell id (CellState id cc))
, setCell : id -> Cell id (CellState id cc) -> CellContainer id cc -> Result String (CellContainer id cc)
, map : (Cell id (CellState id cc) -> Cell id (CellState id cc)) -> CellContainer id cc -> CellContainer id cc
, has : (Cell id (CellState id cc) -> Basics.Bool) -> CellContainer id cc -> Basics.Bool
, makeId : List (Schelme.EvalStep.Term (CellState id cc)) -> Result String id
, showId : id -> String
, cells : cc
}
The record type for CellContainer - a CcRecord should contain an id type, a container type 'cc', and implementations of all these functions.
a type that contains a CcRecord.
when a cell program runs, it has access to CellState, the state of all cells.
cell status may indicate that a cell is blocked because of another cell that needs to finish its program.
the possible outcomes of running all cell programs to completion.
possible results from a PSideEffectorFn
Schelme.EvalStep.NameSpace (CellState id cc) -> CellState id cc -> List (Schelme.EvalStep.Term (CellState id cc)) -> PRes id cc
The type signature of side effector functions in our cellme language. For now there's only one, 'cv'.
the possible run states for a cell program.
cellVal : Schelme.EvalStep.NameSpace (CellState id cc) -> CellState id cc -> List (Schelme.EvalStep.Term (CellState id cc)) -> PRes id cc
the 'cv' function in our schelme script language. given a cell id, attempt to get the value of that cell from the CellState.
cellme : Schelme.EvalStep.NameSpace (CellState id cc)
the cell language is schelme plus 'cv'
compileCells : CellContainer id cc -> CellContainer id cc
compile all cell programs.
compileError : CellContainer id cc -> Basics.Bool
does any cell have a compile error?
continueCell : CellContainer id cc -> Cell id (CellState id cc) -> Cell id (CellState id cc)
continue running a cell program.
evalArgsPSideEffector : PSideEffectorFn id cc -> Schelme.EvalStep.SideEffector (CellState id cc)
just like the regular evalArgsSideEffector, except checks for PrPause from the fn.
evalCell : CellContainer id cc -> Cell id (CellState id cc) -> Cell id (CellState id cc)
reset the cell program, then run to completion (or blockage, anyway)
evalCellsFully : CellContainer id cc -> ( CellContainer id cc, FullEvalResult )
should eval all cells from the start, resulting in an updated array and result type.
evalCellsOnce : CellContainer id cc -> CellContainer id cc
eval all cells, resulting in an updated array.
runCell : CellContainer id cc -> Cell id (CellState id cc) -> Cell id (CellState id cc)
run a cell from its current state to completion.
runCellBody : Schelme.EvalStep.EvalBodyStep (CellState id cc) -> RunState id (CellState id cc)
run the cell program to completion