O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Create a new project called master-slave with the simple stack template:
        stack new using-closure simple
  1. Add a dependency on the distributed-process and distributed-process-localnet libraries in the build-depends sub-section of the executable section:
        executable using-closure
          hs-source-dirs:      src
          main-is:             Main.hs          ghc-options:         -threaded
          default-language:    Haskell2010
          build-depends:       base >= 4.7 && < 5
                             , distributed-process
                             , distributed-process-simplelocalnet

At the time of writing this recipe, some of the dependencies are not resolved through stackage LTS. Add the following to stack.yaml:

        extra-deps:
          - distributed-process-0.6.6
          - distributed-process-simplelocalnet-0.2.3.3
          - syb-0.6
  1. Open src/Main.hs. We will be adding our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required