kowainik / stan

🕵️ Haskell STatic ANalyser
https://kowainik.github.io/projects/stan
Mozilla Public License 2.0
562 stars 48 forks source link

Unable to load stan into ghci #430

Closed funrep closed 3 years ago

funrep commented 3 years ago

Hi, I am trying to open stan in ghci but get these errors.

GHCi, version 8.10.3: https://www.haskell.org/ghc/  :? for help
[ 1 of 53] Compiling Paths_stan
[ 2 of 53] Compiling Stan.Browse
Failed, one module loaded.
Loaded GHCi configuration from /private/var/folders/0k/fh2qz7tn5cz7_t053dgg70g00000gn/T/haskell-stack-ghci/f5e93f60/ghci-script
Leaving GHCi.
ers/funrep/Sandbox/stan/src/Stan/Browse.hs:46:75: error:
    Variable not in scope: toText :: String -> Data.Text.Internal.Text
   |
46 |                     errorMessage $ "Cannot guess browser for the OS: " <> toText curOs
   |                                                                           ^^^^^^

/Users/funrep/Sandbox/stan/src/Stan/Browse.hs:48:21: error:
    Variable not in scope: exitFailure :: IO ()
   |
48 |                     exitFailure
   |                     ^^^^^^^^^^^

<no location info>: warning: [-Wunused-packages]
    The following packages were specified via -package or -package-id flags,
    but were not needed for compilation:
      - unordered-containers-0.2.13.0
      - trial-tomland-0.0.0.0
      - trial-optparse-applicative-0.0.0.0
      - trial-0.0.0.0
      - tomland-1.3.1.0
      - slist-0.1.1.0
      - pretty-simple-4.0.0.0
      - optparse-applicative-0.15.1.0
      - microaeson-0.1.0.0
      - gitrev-1.3.1
      - ghc-boot-th-8.10.3
      - ghc-8.10.3
      - filepath-1.4.2.1
      - extensions-0.0.0.1
      - dir-traverse-0.2.2.3
      - cryptohash-sha1-0.11.100.1
      - containers-0.6.2.1
      - clay-0.13.3
      - blaze-html-0.9.1.2
      - base64-0.4.2.2
      - array-0.5.4.0
      - relude-0.7.0.0
      - stan-0.0.1.0

<no location info>: error:
    Could not load module ‘Stan’
    It is a member of the hidden package ‘stan-0.0.1.0’.
    You can run ‘:set -package stan’ to expose it.
    (Note: this unloads all the modules in the current scope.)

It seems to be that it does not load the correct Prelude. Any idea how I might fix this?

chshersh commented 3 years ago

Hi @funrep, do you use stack to load Stan in GHCi? If so, I believe you're experiencing the following Stack issue:

funrep commented 3 years ago

@chshersh that seems to be the case.

cabal repl stan seem to get me what I needed, I will mark as solved.