Package org.openquark.cal_Cal_Core_Prelude

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe


   * f3S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.getNeighbours
   */
  public final RTValue f3S(RTValue $dictvarCal_Core_Prelude_Eq_32, RTValue graph, RTValue vertex, 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_32, graph, vertex, $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return Get_Neighbours.i_Nil;
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue vertexNum = $case1.get_value();

        return
          Indices_To_Vertices.$instance.f2S(
            graph,
            new RTFullApp.General._2._S(
View Full Code Here


        graph,
        vertex1,
        $ec);

    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)Get_Maybe_Vertex_Number.$instance.f3S($dictvarCal_Core_Prelude_Eq_48, graph, mergedVertex, $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return
          Merge_Vertices.mergedWithEachother$8$def_Lazy(
            $dictvarCal_Core_Prelude_Eq_48,
            graph,
            vertex2,
            retainLoops,
            letVar_vertex1Num,
            mergedVertex,
            $ec);
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue mergedVertexNum = $case1.get_value();

        return
          Merge_Vertices_Internal.$instance.f6S(
            $dictvarCal_Core_Prelude_Eq_48,
            Merge_Vertices.mergedWithEachother$8$def_Lazy(
View Full Code Here

   * f3S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.removeVertex
   */
  public final RTValue f3S(RTValue $dictvarCal_Core_Prelude_Eq_21, RTValue oldGraph, RTValue vertex, 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_21, oldGraph, vertex, $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return oldGraph;
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue vertexNum = $case1.get_value();


        RTCons $case2 =
          ((RTCons)(java.lang.Object)oldGraph.evaluate($ec));

View Full Code Here

   * f2S
   * This method implements the function logic of the CAL function Cal.Samples.DirectedGraphLibrary.findReachableCycle
   */
  public final RTValue f2S(RTValue graph, RTValue startVertex, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)org.openquark.cal_Cal_Utilities_DirectedGraph.Find_Reachable_Cycle.$instance.f3S(_dict___Eq___Vertex.$instance, graph, startVertex, $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return RTData.CAL_Opaque.make(null);
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue cycle = $case1.get_value();

        return
          Output_List.$instance.f1S(
            Output_J_Object.$instance,
            $ec).evaluate(
View Full Code Here

   * f1S
   * This method implements the function logic of the CAL function Cal.Samples.DirectedGraphLibrary.findCycle
   */
  public final RTValue f1S(RTValue graph, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)org.openquark.cal_Cal_Utilities_DirectedGraph.Find_Cycle.$instance.f2S(_dict___Eq___Vertex.$instance, graph, $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return RTData.CAL_Opaque.make(null);
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue cycle = $case1.get_value();

        return
          Output_List.$instance.f1S(
            Output_J_Object.$instance,
            $ec).evaluate(
View Full Code Here

      Map__merge_If_Duplicate__8.seenEntries$12$def_Lazy(
        accumPair.getValue(),
        $ec);

    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)Map__merge_If_Duplicate__8.maybeDuplicate$15$def_Strict($dictvarCal_Core_Prelude_Eq_44, entry.getValue(), letVar_seenEntries, $ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return
          RTRecordValue.makeTupleRecord(
            new RTValue[] {new TYPE_List.CAL_Cons(entry.getValue(), letVar_seenEntries), Map__merge_If_Duplicate__8.graph$13$def_Lazy(accumPair.getValue(), $ec)});
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue duplicate = $case1.get_value();

        return
          RTRecordValue.makeTupleRecord(
            new RTValue[] {letVar_seenEntries, new RTFullApp.General._6._S(Merge_Vertices_Internal.$instance, $dictvarCal_Core_Prelude_Eq_44, Map__merge_If_Duplicate__8.graph$13$def_Lazy(accumPair.getValue(), $ec), RTData.CAL_Boolean.make(true), Map__merge_If_Duplicate__8.duplicateNum$19$def_Lazy(duplicate, $ec), Map__merge_If_Duplicate__8.entryNum$18$def_Lazy(entry.getValue(), $ec), Map__merge_If_Duplicate__8.duplicateVertex$20$def_Lazy(duplicate, $ec))});
      }
View Full Code Here

   * f4S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.findPermutation$addIndex$3
   */
  public final RTValue f4S(RTValue $dictvarCal_Core_Prelude_Eq_4, RTValue list2, RTValue elem1, RTValue accum, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)accum.evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return Find_Permutation__add_Index__3.i_Nothing;
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue perm = $case1.get_value();

        TYPE_Maybe $case2;

        switch (($case2 = (((TYPE_Maybe)(java.lang.Object)Find_Index.$instance.f2S(new RTPartialApp._3._2(_lambda__find_Permutation__1.$instance, $dictvarCal_Core_Prelude_Eq_4, elem1), list2.evaluate($ec), $ec).evaluate($ec)))).getOrdinalValue()) {

          case 0: {
            // Cal.Core.Prelude.Nothing
            return Find_Permutation__add_Index__3.i_Nothing;
          }

          case 1: {
            // Cal.Core.Prelude.Just
            // Decompose data type to access members.
            RTValue index = $case2.get_value();

            return
              new TYPE_Maybe.CAL_Just(
                new TYPE_List.CAL_Cons(index, perm));
          }
View Full Code Here

    RTValue isCycle = $recordCase1.getOrdinalFieldValue(2);

    if (isCycle.evaluate($ec).getBooleanValue()) {
      return accum;
    } else {
      TYPE_Maybe $case2;

      switch (($case2 = (((TYPE_Maybe)(java.lang.Object)Find_Index.$instance.f2S(new RTPartialApp._2._1(_lambda__find_Cycle_Internal__1.$instance, vertexNum), path.evaluate($ec), $ec).evaluate($ec)))).getOrdinalValue()) {

        case 0: {
          // Cal.Core.Prelude.Nothing
          return accum;
        }

        case 1: {
          // Cal.Core.Prelude.Just
          // Decompose data type to access members.
          RTValue index = $case2.get_value();

          return
            RTRecordValue.makeTupleRecord(
              new RTValue[] {new RTFullApp.General._2._L(Take.$instance, new RTFullApp.General._2._L(Add_Int.$instance, index, Find_Cycle_Internal__revisit_Vertex_Fn__4.$L1_Int_1), path), RTData.CAL_Boolean.make(true)});
        }
View Full Code Here

   * f3S
   * This method implements the function logic of the CAL function Cal.Samples.DirectedGraphLibrary.findPath
   */
  public final RTValue f3S(RTValue graph, RTValue startVertex, RTValue endVertex, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)org.openquark.cal_Cal_Utilities_DirectedGraph.Find_Path.$instance.f4S(_dict___Eq___Vertex.$instance, graph, startVertex, endVertex, $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return RTData.CAL_Opaque.make(null);
      }

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue path = $case1.get_value();

        return
          Output_List.$instance.f1S(
            Output_J_Object.$instance,
            $ec).evaluate(
View Full Code Here

   * 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});
      }
View Full Code Here

TOP

Related Classes of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.