title: How to import adjacent module when running .hs file as script
body: <p>I was following the directions here:
  <a href="https://haskell.fpcomplete.com/tutorial/stack-script" rel="nofollow noreferrer">https://haskell.fpcomplete.com/tutorial/stack-script</a></p>
  
  <p>I have a cabal/stack project with this file structure:</p>
  
  <pre><code>app/Main.hs
  src/Lib.hs
  </code></pre>
  
  <p>I can run Main.hs with:</p>
  
  <pre><code>stack runghc -- app/Main.hs 
  </code></pre>
  
  <p>that works if Main.hs does not import Lib.hs, but if it does, I get this error:</p>
  
  <pre><code>app/Main.hs:3:1: error:
      Ambiguous module name ‘Lib’:
        it was found in multiple packages:
        haskell-starter-0.1.0.0 libiserv-8.6.3
    |
  3 | import Lib
    | ^^^^^^^^^^
  </code></pre>
  
  <p>is there anyway to include the src/Lib.hs file in the build? For a package it would look like:</p>
  
  <pre><code>stack runghc --package xyz -- app/Main.hs 
  </code></pre>
  
  <p>but what about for a module or file? Something like:</p>
  
  <pre><code>stack runghc --module src/Lib.hs -- app/Main.hs 
  </code></pre>
  
  <p>?</p>
  
  <p><strong>Update</strong>: So I tried this:</p>
  
  <pre><code>stack runghc -- -i src/* app/Main.hs
  </code></pre>
  
  <p>And I got:</p>
  
  <blockquote>
  <pre><code>src/Lib.hs:0:66: error:
      • Variable not in scope: main :: IO a0
      • Perhaps you meant ‘min’ (imported from Prelude)
  </code></pre>
  </blockquote>