[Haskell-beginners] Can't build project properly

Galaxy Being borgauf at gmail.com
Sat Jul 3 04:45:21 UTC 2021


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
<https://schooloffp.co/2020/12/05/whirlwind-tour-of-stack-for-beginners.html>
that tells me to put the extra packages in package.yaml. Very confused at
this point.

⨽
Lawrence Bottorff
Grand Marais, MN, USA
borgauf at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20210702/33ae16df/attachment.html>


More information about the Beginners mailing list