Examples of TYPE_Maybe


Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

    // Top level supercombinator logic
    if (Length.$instance.fUnboxed1S(list1.evaluate($ec), $ec) !=
    Length.$instance.fUnboxed1S(list2.evaluate($ec), $ec)) {
      return Find_Permutation.i_Nothing;
    } else {
      TYPE_Maybe $case2;

      switch (($case2 = (((TYPE_Maybe)(java.lang.Object)Fold_Right.$instance.f3S(new RTPartialApp._4._2(Find_Permutation__add_Index__3.$instance, $dictvarCal_Core_Prelude_Eq_4, list2), new TYPE_Maybe.CAL_Just(Find_Permutation.i_Nil), list1.evaluate($ec), $ec).evaluate($ec)))).getOrdinalValue()) {

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

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

          return
            new TYPE_Maybe.CAL_Just(
              new RTFullApp.General._1._L(
                From_List.$instance,
View Full Code Here

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

          // Cal.Core.Prelude.Cons
          // Decompose data type to access members.
          RTValue listHead = $case1.get_head();
          RTValue listTail = $case1.get_tail();

          TYPE_Maybe $case2;

          switch (($case2 = (((TYPE_Maybe)(java.lang.Object)mapFunction.f1L(listHead, $ec).evaluate($ec)))).getOrdinalValue()) {

            case 0: {
              // Cal.Core.Prelude.Nothing
              list = listTail.evaluate($ec);
              continue TRLoop;
            }

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

              return
                new TYPE_List.CAL_Cons(
                  value,
                  new RTFullApp.General._2._L(
View Full Code Here

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

   * f7S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.foldDFSInternal
   */
  public final RTValue f7S(RTValue $dictvarCal_Core_Prelude_Eq_1, RTValue maybeStartVertex, RTValue startVertexFn, RTValue revisitVertexFn, RTValue finishVertexFn, RTValue init, RTValue graph, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

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

      case 0: {
        // Cal.Core.Prelude.Nothing
        return
          new Fold_D_F_S_Internal__dfs_All__9.RTAppS(
            Fold_D_F_S_Internal__dfs_All__9.$instance,
            Fold_D_F_S_Internal.dfsHelper$7$def_Lazy(
              graph,
              startVertexFn,
              revisitVertexFn,
              finishVertexFn,
              $ec),
            Fold_D_F_S_Internal.i_Tip,
            init.evaluate($ec),
            Keys.$instance.f1S(
              (((RTCons)(java.lang.Object)
                graph.evaluate($ec))).getFieldByIndex(
                0,
                1,
                Fold_D_F_S_Internal.Cal_Utilities_DirectedGraph_foldDFSInternal_980_61).evaluate(
                $ec),
              $ec).evaluate(
              $ec));
      }

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

        TYPE_Maybe $case2;

        switch (($case2 = (((TYPE_Maybe)(java.lang.Object)Get_Maybe_Vertex_Number.$instance.f3S($dictvarCal_Core_Prelude_Eq_1, graph, startVertex, $ec).evaluate($ec)))).getOrdinalValue()) {

          case 0: {
            // Cal.Core.Prelude.Nothing
            return
              Trace.$instance.f1S(
                Fold_D_F_S_Internal.message$23$def_Unboxed(
                  startVertex,
                  graph,
                  $ec),
                $ec).evaluate(
                $ec).apply(
                new RTError.RTAppS(
                  RTError.$instance,
                  RTData.CAL_Opaque.make(
                    Fold_D_F_S_Internal.Cal_Utilities_DirectedGraph_foldDFSInternal_992_43),
                  "Invalid start node."));
          }

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

            return
              Fold_D_F_S_Internal__dfs_Reachable__8.$instance.f3S(
                Fold_D_F_S_Internal.dfsHelper$7$def_Lazy(
                  graph,
View Full Code Here

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

        // Decompose data type to access members.
        int ky$U = $case1.get_key_As_Int();
        RTValue y = $case1.get_value();

        if (k == ky$U) {
          TYPE_Maybe $case5;

          switch (($case5 = (((TYPE_Maybe)(java.lang.Object)f.f2L(RTData.CAL_Int.make(k), y, $ec).evaluate($ec)))).getOrdinalValue()) {

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

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

              return new TYPE_Int_Map.CAL_Tip(ky$U, yNew);
            }

            default: {
View Full Code Here

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

   * f3S
   * This method implements the function logic of the CAL function Cal.Collections.IntMap.lookupWithDefault
   */
  public final RTValue f3S(int key, RTValue map, RTValue defaultValue, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)Lookup.$instance.f2S(key, map.getValue(), $ec).evaluate($ec)))).getOrdinalValue()) {

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

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

        return x;
      }

      default: {
View Full Code Here

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

   * f3S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.partition$getMaybeAdjacencyNode$13
   */
  public final RTValue f3S(RTValue edges, RTValue invalidEndpoints, RTValue vertexNum, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)Lookup.$instance.f2S(vertexNum.evaluate($ec).getOrdinalValue(), edges.getValue(), $ec).evaluate($ec)))).getOrdinalValue()) {

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

      case 1: {
        // Cal.Core.Prelude.Just
        // Decompose data type to access members.
        RTValue allEndpoints = $case1.get_value();
        RTValue letVar_validEndpoints =
          Partition__get_Maybe_Adjacency_Node__13.validEndpoints$23$def_Lazy(
            allEndpoints,
            invalidEndpoints,
            $ec);
View Full Code Here

Examples of org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe

   * f2S
   * This method implements the function logic of the CAL function Cal.Collections.IntMap.find
   */
  public final RTValue f2S(int k, RTValue m, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    TYPE_Maybe $case1;

    switch (($case1 = (((TYPE_Maybe)(java.lang.Object)Lookup.$instance.f2S(k, m.getValue(), $ec).evaluate($ec)))).getOrdinalValue()) {

      case 0: {
        // Cal.Core.Prelude.Nothing
        return
          RTError.$instance.f2S(
            RTData.CAL_Opaque.make(
              Find.Cal_Collections_IntMap_find_468_16),
            "Key is not an element of the map",
            $ec);
      }

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

        return x;
      }

      default: {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.