How to do it...

  1. Create a new project, auth-in-snap, with a simple stack template:
        stack new auth-in-snap simple
  1. Add a dependency on the snap-core library in the build-depends subsection of the executable section.
  executable auth-in-snap
    hs-source-dirs:      src
    main-is:             Main.hs
    default-language:    Haskell2010
    build-depends:       base >= 4.7 && < 5
                       , snap-core
                       , snap-server
                       , snaplet-sqlite-simple
                       , heist
                       , snap
                       , lens
                       , bytestring
                       , text
                       , map-syntax
  1. Use the following command to solve the constraints within the current resolver. For this recipe, we have used lts-9.1 as a resolver:
  stack --resolver lts-9.1 solver --update-config
  1. Copy the archive from It is a set of ...

Get Haskell Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.