haskellfunctional-programmingconsolehaskell-prelude

how to change to prelude console in haskell for execution of monads


Hi I am trying to run a custom monad by using prelude as suggested here:Calling a custom monad in haskell using the bind , by using Prelude Control.Monad> runCustomM cm "foo"

However when I try to do the import Control.Monad nothing happens an the prompt type doesn't change. Likewise nothing happens when I use the System.IO as suggested here: https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/ghci.html

How can I execute the prelude correctly s.t. I can execute my own Monads?

I tried

Loaded package environment from C:\Users\tqx98\AppData\Roaming\ghc\x86_64-mingw32-9.0.1\environments\default
GHCi, version 9.0.1: https://www.haskell.org/ghc/  :? for help

ghci> import Control.Monad
ghci> import System.IO 
ghci> 

The above is more or less all that happens.


Solution

  • When I try to do the import Control.Monad nothing happens an the prompt type doesn't change.

    This appears to be the expected behaviour in your version of GHCi, see the documentation of v9.0.1 (contrasting with that of v8.4.2 which you linked). In my experience, the long prompt was quite annoying when importing a lot of modules, so I'd consider it an improvement.

    It just be working just fine to call the functions from the imported modules.