From: Jesse Gibbons <jgibbons2357@gmail.com>
To: John Soo <jsoo1@asu.edu>
Cc: help-guix mailing list <help-guix@gnu.org>
Subject: Re: How to make sure ghc uses installed packages?
Date: Mon, 16 Sep 2019 19:28:26 -0600 [thread overview]
Message-ID: <2d89fac1d7f27dada3ab161b69fa1a361485ad89.camel@gmail.com> (raw)
In-Reply-To: <68B49FDD-A221-4E8D-B385-D483DB52E6CD@asu.edu>
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
On Mon, 2019-09-16 at 17:00 -0700, John Soo wrote:
> Hi Jesse,
>
> > Can somebody help me out please?
>
> I can try!
>
> Can get the contents of $GHC_PACKAGE_PATH please? Guix uses this
> environment variable that is recognized by the ghc toolchain to tell
> ghc where packages are installed.
>
> What happens if you try to load your file in ghci instead of using
> runhaskell?
>
> Good luck,
>
> - John
I wrote a script to do that (attached with output), then for each each
of the available versions, removed all ghc, logged into a virtual
terminal, ran the script, then logged out of the virtual terminal. I
did the log in/out because I previously noticed GHC_PACKAGE_PATH did
not change, even when I uninstalled everything, so I suspected it was
linked to a login script.
It appears the required modules were in GHC_PACKAGE_PATH and the
program did not have an error when I used ghc version 8.4.3
I noticed when I installed each successive version of GHC it suggests I
run a script to update the environment variables. I usually ignored it
because I did not have a problem like this before.
Case closed I guess.
[-- Attachment #2: output.txt --]
[-- Type: text/plain, Size: 6523 bytes --]
GHC_PACKAGE_PATH=/home/jesse/.guix-profile/lib/ghc-8.6.5/package.conf.d
runhaskell:
tutorial.hs:2:1: error:
Could not find module ‘Text.Regex’
Perhaps you meant Text.Read (from base-4.12.0.0)
Use -v to see a list of the files searched for.
|
2 | import Text.Regex
| ^^^^^^^^^^^^^^^^^
tutorial.hs:3:1: error:
Could not find module ‘System.Random’
Use -v to see a list of the files searched for.
|
3 | import System.Random
| ^^^^^^^^^^^^^^^^^^^^
ghci:
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude> Prelude Data.List>
<no location info>: error:
Could not find module ‘Text.Regex’
Perhaps you meant Text.Read (from base-4.12.0.0)
Prelude Data.List>
<no location info>: error:
Could not find module ‘System.Random’
It is not a module in the current program, or in any known package.
Prelude Data.List> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord>
<interactive>:16:38: error:
Not in scope: type constructor or class ‘StdGen’
<interactive>:16:54: error:
Not in scope: type constructor or class ‘StdGen’
Prelude Data.List Data.Ord> Prelude Data.List Data.Ord>
<interactive>:18:8: error: Empty 'do' block
Prelude Data.List Data.Ord>
<interactive>:19:2: error:
• Variable not in scope: putstr :: [Char] -> t
• Perhaps you meant ‘putStr’ (imported from Prelude)
Prelude Data.List Data.Ord> Leaving GHCi.
GHC_PACKAGE_PATH=/home/jesse/.guix-profile/lib/ghc-8.4.3/ghc-random-1.1.conf.d:/home/jesse/.guix-profile/lib/ghc-8.4.3/ghc-regex-compat-0.95.1.conf.d:/home/jesse/.guix-profile/lib/ghc-8.4.3/package.conf.d
runhaskell:
tutorial.hs:19:2: error:
• Variable not in scope: putstr :: [Char] -> t
• Perhaps you meant ‘putStr’ (imported from Prelude)
|
19 | putstr "Hello World! Let's have a picnic! \n"
| ^^^^^^
ghci:
GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help
Prelude> Prelude Data.List> Prelude Data.List Text.Regex> Prelude Data.List Text.Regex System.Random> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord> Prelude Data.List Text.Regex System.Random Data.Ord>
<interactive>:18:8: error: Empty 'do' block
Prelude Data.List Text.Regex System.Random Data.Ord>
<interactive>:19:2: error:
• Variable not in scope: putstr :: [Char] -> t
• Perhaps you meant ‘putStr’ (imported from Prelude)
Prelude Data.List Text.Regex System.Random Data.Ord> Leaving GHCi.
GHC_PACKAGE_PATH=/home/jesse/.guix-profile/lib/ghc-8.0.2/package.conf.d
runhaskell:
tutorial.hs:2:1: error:
Failed to load interface for ‘Text.Regex’
Perhaps you meant Text.Read (from base-4.9.1.0)
Use -v to see a list of the files searched for.
tutorial.hs:3:1: error:
Failed to load interface for ‘System.Random’
Use -v to see a list of the files searched for.
ghci:
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Prelude> Prelude Data.List>
<no location info>: error:
Could not find module ‘Text.Regex’
Perhaps you meant Text.Read (from base-4.9.1.0)
Prelude Data.List>
<no location info>: error:
Could not find module ‘System.Random’
It is not a module in the current program, or in any known package.
Prelude Data.List> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord>
<interactive>:16:38: error:
Not in scope: type constructor or class ‘StdGen’
<interactive>:16:54: error:
Not in scope: type constructor or class ‘StdGen’
Prelude Data.List Data.Ord> Prelude Data.List Data.Ord>
<interactive>:18:8: error: Empty 'do' block
Prelude Data.List Data.Ord>
<interactive>:19:2: error:
• Variable not in scope: putstr :: [Char] -> t
• Perhaps you meant ‘putStr’ (imported from Prelude)
Prelude Data.List Data.Ord> Leaving GHCi.
GHC_PACKAGE_PATH=/home/jesse/.guix-profile/lib/ghc-7.10.2/package.conf.d
runhaskell:
tutorial.hs:2:8:
Could not find module ‘Text.Regex’
Perhaps you meant Text.Read (from base-4.8.1.0)
Use -v to see a list of the files searched for.
tutorial.hs:3:8:
Could not find module ‘System.Random’
Use -v to see a list of the files searched for.
ghci:
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Prelude> Prelude Data.List>
<no location info>:
Could not find module ‘Text.Regex’
Perhaps you meant Text.Read (from base-4.8.1.0)
Prelude Data.List>
<no location info>:
Could not find module ‘System.Random’
It is not a module in the current program, or in any known package.
Prelude Data.List> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord> Prelude Data.List Data.Ord>
<interactive>:17:38:
Not in scope: type constructor or class ‘StdGen’
<interactive>:17:54:
Not in scope: type constructor or class ‘StdGen’
Prelude Data.List Data.Ord> Prelude Data.List Data.Ord>
<interactive>:19:6: parse error on input ‘=’
Prelude Data.List Data.Ord>
<interactive>:20:2:
Not in scope: ‘putstr’
Perhaps you meant ‘putStr’ (imported from Prelude)
Prelude Data.List Data.Ord> Leaving GHCi.
[-- Attachment #3: record-ghc-package-path --]
[-- Type: text/plain, Size: 187 bytes --]
OUT=output.txt
echo 'GHC_PACKAGE_PATH='$GHC_PACKAGE_PATH >> $OUT
echo "runhaskell: " >> $OUT
runhaskell tutorial.hs |& cat >> $OUT
echo "ghci: " >> $OUT
ghci < tutorial.hs |& cat >> $OUT
[-- Attachment #4: tutorial.hs --]
[-- Type: text/x-haskell, Size: 514 bytes --]
import Data.List
import Text.Regex
import System.Random
import Data.Ord
type Point = (Float,Float)
type Color = (Int,Int,Int)
type Polygon = [Point]
type Person = [Int]
type Link =[Point]
type Placement = [(Person,Person)]
type EnergyFunction a = a -> Int
type TemperatureFunction = Int -> Int -> Float
type TransitionProbabilityFunction = Int -> Int -> Float -> Float
type MotionFunction a = StdGen -> a -> (StdGen,a)
main = do
putstr "Hello World! Let's have a picnic! \n"
next prev parent reply other threads:[~2019-09-17 1:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-16 22:35 How to make sure ghc uses installed packages? Jesse Gibbons
2019-09-17 0:00 ` John Soo
2019-09-17 1:28 ` Jesse Gibbons [this message]
2019-09-17 5:27 ` John Soo
2019-09-17 12:36 ` Jesse Gibbons
2019-09-17 14:09 ` John Soo
2019-09-17 18:21 ` Timothy Sample
2019-09-17 19:33 ` John Soo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d89fac1d7f27dada3ab161b69fa1a361485ad89.camel@gmail.com \
--to=jgibbons2357@gmail.com \
--cc=help-guix@gnu.org \
--cc=jsoo1@asu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.