<ol>
<li>browse: apparently you can't use the alias of an imported module when browsing</li>
</ol>
<blockquote>
<pre><code>import Data.Maybe as DM
:browse Data.Maybe           ~&gt; works
:browse DM                   ~&gt; throws an error
</code></pre>
</blockquote>
<ol start="2">
<li>info: according to the docs, :i gives you information about a name. The alias of a module is not a name, neither is the name of the module, i.e.</li>
</ol>
<blockquote>
<pre><code>:i Data.Maybe   ~&gt; throws an error  
:i Maybe        ~&gt; works
</code></pre>
</blockquote>
<ol start="3">
<li>type: according to the docs, :t gives you the type of an expression. The alias/name of a module is not an expression, i.e.</li>
</ol>
<blockquote>
<pre><code>:t Data.Maybe   ~&gt; throws an error  
:t Maybe        ~&gt; throws an error, a type is not an expression  
:t Just         ~&gt; works
</code></pre>
</blockquote>
<ol start="4">
<li>let m = PTxBI 17: you need a constructor after the equal sign, not the alias of a module. You could write <code>PTxBI.BuiltinInteger</code>.</li>
</ol>

CC BY-SA 4.0
2022-03-03T04:16:43.197Z
Point #1 was the main thing, and you've basically confirmed my experience (2-4 were just doodles to see what error was produced). I suppose rather than "broken" behavior this is more properly viewed as "incomplete" behavior, but IMHO if you're going to specify an alias for something, that alias should work everywhere that the something works.
XiTouch
CC BY-SA 4.0
2022-03-03T05:47:04.610Z
I couldn't tell you where ghci is maintained, but perhaps you could report this as an issue.
Mihai Codescu
CC BY-SA 4.0
2022-03-02T22:26:00.830Z
2022-03-02T22:26:00.830Z
Mihai Codescu
<p>I'm trying to understand at the lowest level exactly how Plutus/Haskell/Cabal works.</p>
<p>I executed the following in the repl (inside nix):</p>
<pre><code>&gt; import PlutusTx.Builtins.Internal as PTxBI
</code></pre>
<p>Doing this causes no error, and I see the Prelude prompt now includes &quot;PTxBI&quot;.</p>
<p>Yet I cannot work with &quot;PTxBI&quot;. I cannot browse it, get info, etc. The image shows some of my attempts (mostly to see what error messages get generated). I find the &quot;not in scope&quot; errors very curious.</p>
<p>If I enter</p>
<pre><code>&gt; :browse PlutusTx.Builtins.Internal
</code></pre>
<p>I do get meaningful, error-free output.</p>
<p>Why does the repl not recognize &quot;PTxBI&quot;? It obviously recognized it well enough to include it in the Prelude prompt. This feels like broken behavior.</p>
<p><a href="https://i.sstatic.net/fqmvF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fqmvF.png" alt="enter image description here" /></a></p>

<plutus-pioneer-program><cabal><repl>
Trying to understand import, browse, "as" and other terminology
# Trying to understand import, browse, "as" and other terminology

(Asked by: username_0 on 2022-03-02)

I'm trying to understand at the lowest level exactly how Plutus/Haskell/Cabal works.
I executed the following in the repl (inside nix):
> import PlutusTx.Builtins.Internal as PTxBI

Doing this causes no error, and I see the Prelude prompt now includes "PTxBI".
Yet I cannot work with "PTxBI". I cannot browse it, get info, etc. The image shows some of my attempts (mostly to see what error messages get generated). I find the "not in scope" errors very curious.
If I enter
> :browse PlutusTx.Builtins.Internal

I do get meaningful, error-free output.
Why does the repl not recognize "PTxBI"? It obviously recognized it well enough to include it in the Prelude prompt. This feels like broken behavior.

**Tags:** plutus-pioneer-program, cabal, repl

---

## 1 answers

### Answer by username_1 on 2022-03-02. Score: 1 | Accepted answer

browse: apparently you can't use the alias of an imported module when browsing


import Data.Maybe as DM
:browse Data.Maybe           ~> works
:browse DM                   ~> throws an error



info: according to the docs, :i gives you information about a name. The alias of a module is not a name, neither is the name of the module, i.e.


:i Data.Maybe   ~> throws an error  
:i Maybe        ~> works



type: according to the docs, :t gives you the type of an expression. The alias/name of a module is not an expression, i.e.


:t Data.Maybe   ~> throws an error  
:t Maybe        ~> throws an error, a type is not an expression  
:t Just         ~> works



let m = PTxBI 17: you need a constructor after the equal sign, not the alias of a module. You could write PTxBI.BuiltinInteger.

> **Comments:**
> **username_0**: Point #1 was the main thing, and you've basically confirmed my experience (2-4 were just doodles to see what error was produced). I suppose rather than "broken" behavior this is more properly viewed as "incomplete" behavior, but IMHO if you're going to specify an alias for something, that alias should work everywhere that the something works.  
> **username_1**: I couldn't tell you where ghci is maintained, but perhaps you could report this as an issue.  

---

