Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2453

haskell tutorial: fix up division by 0 example

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.2
    • Component/s: Tutorial
    • Labels:
      None
    • Environment:

      The Glorious Glasgow Haskell Compilation System, version 7.6.3
      Linux

    • Patch Info:
      Patch Available

      Description

      Fix the division by 0; exception example in the Haskell tutorial

      Running https://gist.github.com/cheecheeo/9521607#file-test-sh:

      + pushd .cabal-sandbox/bin
      ~/packages/thrift/.cabal-sandbox/bin ~/packages/thrift
      + trap 'kill -9 17219' EXIT
      + ./HaskellServer
      + ./HaskellClient
      "Starting the server..."
      HaskellClient: connect: does not exist (Connection refused)
      + sleep 0.1
      + ./HaskellClient
      "ping()"
      "ping()"
      add(1,1)
      1+1=2
      calculate(1, Work {f_Work_num1 = Just 1, f_Work_num2 = Just 0, f_Work_op = Just DIVIDE, f_Work_comment = Nothing})
      InvalidOperation InvalidOperation {f_InvalidOperation_what = Just 4, f_InvalidOperation_why = Just "Cannot divide by 0"}
      calculate(1, Work {f_Work_num1 = Just 15, f_Work_num2 = Just 10, f_Work_op = Just SUBTRACT, f_Work_comment = Nothing})
      15-10=5
      Check log: 5
      + popd
      ~/packages/thrift
      + kill -9 17219
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                roger Roger Meier
                Reporter:
                cheecheeo John Chee
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: