* f3S
* This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.addVertexInternal
*/
public final RTValue f3S(RTValue $dictvarCal_Core_Prelude_Eq_9, RTValue oldGraph, RTValue newVertex, RTExecutionContext $ec) throws CALExecutorException {
// Top level supercombinator logic
TYPE_Maybe $case1;
switch (($case1 = (((TYPE_Maybe)(java.lang.Object)Get_Maybe_Vertex_Number.$instance.f3S($dictvarCal_Core_Prelude_Eq_9, oldGraph, newVertex, $ec).evaluate($ec)))).getOrdinalValue()) {
case 0: {
// Cal.Core.Prelude.Nothing
RTCons $case2 =
((RTCons)(java.lang.Object)oldGraph.evaluate($ec));
// Cal.Utilities.DirectedGraph.DirectedGraph
// Decompose data type to access members.
TYPE_Directed_Graph.CAL_Directed_Graph $dcCaseVar2 =
((TYPE_Directed_Graph.CAL_Directed_Graph)(java.lang.Object)
$case2);
int oldNextNum$U = $dcCaseVar2.get_nextVertexNum_As_Int();
RTValue oldVertexMap = $dcCaseVar2.get_vertexMap();
RTValue oldEdges = $dcCaseVar2.get_edges();
return
RTRecordValue.makeTupleRecord(
new RTValue[] {new RTFullApp.General._3._L(Add_Vertex_Internal.i_DirectedGraph, RTData.CAL_Int.make(oldNextNum$U + 1), new Insert.RTAppS(Insert.$instance, oldNextNum$U, newVertex, oldVertexMap), oldEdges), RTData.CAL_Int.make(oldNextNum$U)});
}
case 1: {
// Cal.Core.Prelude.Just
// Decompose data type to access members.
RTValue vertexNum = $case1.get_value();
return
RTRecordValue.makeTupleRecord(
new RTValue[] {oldGraph, vertexNum});
}