haskell - Cabal-installed Modules won't import -


there several things i'm confused here, i'll try explain each of them can.

i've been trying install diagrams package haskell, using cabal. i've seen suggested install packages using sandboxes, that's did. that's not clear me sandbox - understand can initialise 1 cabal sandbox init , install packages inside of cabal install, don't see how use packages once they're installed.

i tried compile test-script using ghc, resulted in following error:

diagramstutorial.lhs:3:10:     not find module 'diagrams.prelude'     use -v see list of files searched for. 

with similar error module script supposed load. these modules both included in diagrams package, , cabal seems happy package installed correctly. expect there's simple don't understand, don't know is.

i typed ghc --make diagramstutorial.lhs compile it

that make ghc use regular user package database (that is, not sandbox one). use cabal exec -- ghc --make diagramstutorial.lhs instead, ghc runs in context of sandbox.

you can use ghci within sandbox cabal repl. , naturally, if/when start preparing cabal package, cabal commands (cabal build, etc.) use sandbox if within directory.

something that's not clear me sandbox is

a set of packages accompanying database local directory. beyond cabal.sandbox.config configuration file there hidden directory .cabal-sandbox, in diagrams , other packages installed lie.


Comments