0 Haskell in Depth: How to work with the source code examples
All the source code in this book is written in Haskell so you will definitely need to get a Haskell compiler to work with it. We rely exclusively on the GHC, the Glasgow Haskell Compiler, although there are other compilers as well. Apart from your system distribution you can get GHC by either:
- Stack (haskellstack.org)
- A Minimal GHC installation (www.haskell.org/downloads)
- The Haskell Platform (www.haskell.org/platform/)
In what follows we’ll provide you with the short instructions on how to work with the source code examples that accompany this book. Depending on your own preferences you may choose which packaging and building approach to take, we support both stack and cabal tools which are customary for Haskell projects.
All the source code examples in this book are organized into a Haskell package which is uploaded to Hackage (hackage.haskell.org/package/hid-examples). Consequently, the easiest way to get all the examples is to download this package from Hackage using cabal (updating may be required in order to get the most current version):
$ cabal update $ cabal get hid-examples
or with stack:
$ stack unpack hid-examples
This will create a hid-examples-0.1.0.0 subdirectory in the current directory and you can start exploring the package content on your own.
Alternatively, you may clone GitHub repository (github.com/bravit/hid-examples/):
$ git clone https://github.com/bravit/hid-examples.git