haskellghci

GHCI vs Prelude command prompt in Haskell


I am trying to learn Haskell from the beginning and was wondering what exactly is the difference between the two prompts (Haskell and Prelude) that are used in it. It may sound a very naive question and not to mention I tried searching for the answer before posting this question but couldn't find one (proper one). Thank you in advance.


Solution

  • Okay, if I'm understanding this correctly, you're wondering if there's a difference between

    Prelude> 
    

    and

    ghci>
    

    as prompts after you've invoked GHCi from the command line.

    If this is the case, then there is no real difference aside from preference. You can change the prompt to whatever you want to by using the command:

    :set prompt "aglebargle> "
    

    You can replace arglebargle> with whatever you'd like.

    The main advantage I see for the Prelude> prompt is that it will update when you import modules. Prelude is the only module you have without any imports, which is why it's the prompt. E.g., if you, say, did import Control.Monad, you'd get Prelude Control.Monad> as a prompt.