<div dir="ltr"><div>if you're using stack, then indeed, as Sylvain said.</div><div>if not, this means that the ghci that is being used, and it's relevant haskell does not have "random" installed. so for example if this is the system installed one, install the relevant package with haskell's random too.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 16, 2022 at 9:55 AM Sylvain Henry <<a href="mailto:sylvain@haskus.fr">sylvain@haskus.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
With Stack:<br>
<br>
 > stack ghci --resolver=lts-18.28 --package=random arrows.hs<br>
<br>
You can use Stack's script feature to specify resolver and packages <br>
directly in the .hs file. See <br>
<a href="https://www.wespiser.com/posts/2020-02-02-Command-Line-Haskell.html" rel="noreferrer" target="_blank">https://www.wespiser.com/posts/2020-02-02-Command-Line-Haskell.html</a> for <br>
some examples.<br>
<br>
Cheers,<br>
Sylvain<br>
<br>
<br>
On 16/06/2022 01:39, Lists0 wrote:<br>
> Hi all,<br>
><br>
> a very basic question, that I cannot solve alone:<br>
> How do I load modules from hackage into ghci ?<br>
> Say, I have a module arrows.hs :<br>
><br>
> {-# LANGUAGE Arrows #-}<br>
><br>
> module Main where<br>
> import Control.Arrow<br>
> import Control.Monad<br>
> import qualified Control.Category as Cat<br>
> import Data.List<br>
> import Data.Maybe<br>
> import System.Random<br>
><br>
><br>
> I get the error in ghci:<br>
><br>
> % ghci arrows.hs<br>
> GHCi, version 8.10.6: <a href="https://www.haskell.org/ghc/" rel="noreferrer" target="_blank">https://www.haskell.org/ghc/</a>  :? for help<br>
> [1 of 1] Compiling Main             ( arrows.hs, interpreted )<br>
><br>
> arrows.hs:9:1: error:<br>
>      Could not find module ‘System.Random’<br>
>      Use -v (or `:set -v` in ghci) to see a list of the files searched<br>
> for. |<br>
> 9 | import System.Random<br>
>    | ^^^^^^^^^^^^^^^^^^^^<br>
> Failed, no modules loaded.<br>
> Prelude><br>
><br>
><br>
> System.Random is in the package "random" from hackage, where the other<br>
> modules are in the package base.<br>
><br>
> I cannot find a solution in the doku that works :-(<br>
><br>
> Thanks for help!<br>
><br>
> _______________________________________________<br>
> Beginners mailing list<br>
> <a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><img src="https://projecteuler.net/profile/yehoshua.png"><br></div><div dir="ltr"><br></div></div></div></div>