You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "John Chee (JIRA)" <ji...@apache.org> on 2014/05/06 08:17:15 UTC

[jira] [Commented] (THRIFT-2401) Haskell tutorial compiles

    [ https://issues.apache.org/jira/browse/THRIFT-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13990333#comment-13990333 ] 

John Chee commented on THRIFT-2401:
-----------------------------------

[~roger.meier] one of the fixes in THRIFT-2453 is a strictness annotation on the return value of {{calculate}} in the server. Can you try and base your patch on the small modifications included in that patch?

Also, I have a a patch (1) that modifies the {{calculate}} function of the server to compute in {{MaybeT IO}} rather that {{IO}}, that allows us to avoid using the strictness annotation ({{IO}} takes care of the strictness for us). I can upload a patch on JIRA if that's more convenient.

(1) https://github.com/cheecheeo/thrift/tree/fix_hs_tutorial_TODO_transformers

> Haskell tutorial compiles
> -------------------------
>
>                 Key: THRIFT-2401
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2401
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Haskell - Compiler, Haskell - Library, Tutorial
>         Environment: Ubuntu
> The Glorious Glasgow Haskell Compilation System, version 7.6.3
>            Reporter: John Chee
>            Assignee: Roger Meier
>         Attachments: 0001-THRIFT-2401-Haskell-tutorial-compiles.patch, haskell_tutorial_compiles.patch
>
>
> This patch fixes compilation on the Haskell tutorial.
> Running: https://gist.github.com/cheecheeo/9521607
> Before this patch results in:
> {code}
> ...
> Building ThriftTutorial-0.1.0...
> Preprocessing executable 'HaskellServer' for ThriftTutorial-0.1.0...
> on the commandline: Warning:
>     -fglasgow-exts is deprecated: Use individual extensions instead
> ../gen-hs/Shared_Types.hs:33:8:
>     Could not find module `Thrift.Types'
>     It is a member of the hidden package `thrift-1.0.0'.
>     Perhaps you need to add `thrift' to the build-depends in your .cabal file.
>     Use -v to see a list of the files searched for.
> Failed to install ThriftTutorial-0.1.0
> cabal: Error: some packages failed to install:
> ThriftTutorial-0.1.0 failed during the building phase. The exception was:
> ExitFailure 1
> {code}
> After this patch results in:
> {code}
> ...
> on the commandline: Warning:
>     -fglasgow-exts is deprecated: Use individual extensions instead
> Linking dist/dist-sandbox-ca46c903/build/HaskellClient/HaskellClient ...
> Installing executable(s) in /home/jchee/packages/thrift/.cabal-sandbox/bin
> Installed ThriftTutorial-0.1.0
> + popd
> ~/packages/thrift/tutorial ~/packages/thrift
> + popd
> ~/packages/thrift
> {code}
> Also, runnning the Haskell server and client produces expected output:
> {code}
> + pushd .cabal-sandbox/bin
> ~/packages/thrift/.cabal-sandbox/bin ~/packages/thrift
> + trap 'kill -9 19091' EXIT
> + ./HaskellServer
> + ./HaskellClient
> "Starting the server..."
> "ping()"
> "ping()"
> add(1,1)
> 1+1=2
> 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 19091
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)