I'm trying to do a basic stack project named http-lesson (Chapter 39 from Get Programming with Haskell) which starts out with this in Main.hs

module Main where

import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Lazy.Char8 as LC
import Network.HTTP.Simple

After doing stack new http-lesson, the books says to modify the http-lesson.cabal file in the project, adding bytestring and http-conduit for the imports noted above

executable http-lesson-exe
  main-is: Main.hs
  other-modules:
      Paths_http_lesson
  hs-source-dirs:
      app
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base >=4.7 && <5
    , http-lesson
    ,  bytestring
    , http-conduit
  default-language: Haskell2010


Being a beginner, I follow the cookbook-like directions, i.e., I next run stack build . . . and it errors out, not finding the imported stuff. But then when I check the http-lesson.cabal file, the extra packages I added have been removed. Hunting around, I find this that tells me to put the extra packages in package.yaml. Very confused at this point.


Lawrence Bottorff
Grand Marais, MN, USA
borgauf@gmail.com