WebGear User Guide¶
This guide is designed to help you get started with WebGear. It follows a tutorial style; if you are looking for reference material, see the API documentation.
This guide assumes that you have a good idea of how HTTP APIs work in general. You also need a good understanding of Haskell programming language features such as type classes, monads, monad transformers etc.
WebGear uses a small set of GHC Haskell features that are generally considered advanced. But this guide does not assume that you are an expert in these. All such features will be explained in this guide.
However, it is assumed that you understand some basic GHC language extensions such as OverloadedStrings, TypeApplications, and FlexibleContexts. A cursory understanding of QuasiQuotes is useful but not essential.
Let us set up a project first.
Create a project¶
stack new webgear-guide simple --resolver lts-16.12 cd webgear-guide
cabal update mkdir webgear-guide cd webgear-guide cabal init --application-dir=src
webgear-guide.cabal and add the following dependencies under
build-depends: base ==184.108.40.206 , webgear-server ==0.2.0 , mtl ==2.2.2 , wai ==220.127.116.11 , warp ==3.3.13 , text ==18.104.22.168 , bytestring ==0.10.10.1 , utf8-string ==22.214.171.124 , time ==1.9.3 , unordered-containers ==0.2.10.0 , hashable ==126.96.36.199 , aeson ==188.8.131.52 , http-types ==0.12.3
In addition to this, if you are using stack, add the following to
extra-deps: - webgear-server-0.2.0
If this is the first time you are setting up the project, it will take a long time to download and build the dependencies. Subsequent builds will use cached artifacts and will be faster.