Haskell Cabal Package - Cannot Find Paths_ Module

I am working on a Haskell project (Happstack server + Blaze HTML / front-end as main libraries) and I want to add a static data directory.

It looks like you can do it with Cabal using an automatically generated module Path_<package_name>. Therefore, in my example, the package is called new-website, so the module must be called Paths_new_website.

Link to Cabal docs re: custom package Paths_pkgname.

From the command line and with the help cabal repl, I try to confirm that I will have access to the module Paths_. However, I found that the module is Paths_new_websitenot imported by Cabal at startup cabal_repl.

Here is a link to some appropriate code and terminal output via gist.

Does anyone have any experience with this by getting the Paths_ Finish module to load with my package? I suspect this may be a matter of lexical scope between Main.hs(the main source file) and the context in cabal_repl...

+4
source share
1 answer

Paths_*modules are only generated by Cabal during assembly. If you use the package with GHCior cabal repl, then they simply will not exist, and your code will fail with "Unable to find module" errors.

, : Paths_* haskell-source-dir. GHCi , , . Cabal , Paths_*.

, src/Paths_stackbuilders.hs datadir.

+4

Source: https://habr.com/ru/post/1525508/


All Articles