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 hedis-trie with a simple stack template:
        stack new hedis-trie simple
  1. Add a dependency on the hedis library in the build-depends sub-section of the executable section:
        executable hedis-trie
          hs-source-dirs:      src
          main-is:             Main.hs
          default-language:    Haskell2010
          build-depends:       base >= 4.7 && < 5
                             , hedis
                             , bytestring
  1. Open src/Main.hs. We will be adding our source here.

  1. Add the initial module declaration and import the required headers. Enable OverloadedStrings as we will be dealing with ByteString in this recipe:
 {-# LANGUAGE OverloadedStrings #-} module Main where import Prelude as P import Database.Redis import Data.ByteString.Char8 as B import Data.Char import Data.Monoid import Control.Monad ...

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