Haskell Import MissingH - haskell

I'm trying to import the Data.String.Utils module in my Haskell code, this is part of the MissingH package. I've installed cabal and used it to acquire MissingH, which is properly installed. However, wehn I try adding
import Data.String.Utils
to my code, WinHugs returns
ERROR file:.\ex.hs - Can't find imported module "Data.String.Utils"
Any feedback?

You already have MissingH installed with Cabal.
Using Cabal packages with WinHugs is hit and miss.
Use ghci and import Data.String.Utils should work.

Related

How import modules in haskell

I'm trying to use this module in my haskell code: (http://hackage.haskell.org/package/MissingH-1.0.0/docs/Data-String-Utils.html) to use the function "replace" - However, when I try this code:
import Data.String.Utils
Haskell tells me there is no such module.
I've installed cabal and stack to do stack build and cabal build

Haskell Language Server in VS code shows 'could not find module' Error

I have the following imports in my file
import Control.Applicative (Applicative(liftA2))
import Control.Monad ( guard )
import qualified Data.Vector as V
and I get the error that reads could not find module 'Data.Vector'
The module is installed. I have vector in dependencies and the program builds fine. I just can't get rid of the error in VS Code.
What extra installations do I have to do to fix this?
I have tried:
cabal install vector --lib
Have you tried?
cabal install vector --lib

Haskell: same module found twice - "Ambiguous module name"

I have the following import in a haskell file. I'm using cabal.
import Network.Wai (Application, Response, rawPathInfo, responseFile, responseLBS, requestBody)
But I'm getting this error when I try to build the file:
Error: Ambiguous module name ‘Network.Wai’:
it was found in multiple packages: wai-3.2.2.1 wai-3.2.2.1
Note that the multiple packages are exactly the same. Something like -XPackageImports doesn't work here, because for some reason the same package is installed twice.
I opened up /Users/<user>/.cabal/store/ghc-8.6.5/package.db and sure enough, there were two "w" (wai) packages with the same version but different hashes. I deleted one and this didn't fix it.

Anyone having trouble install Control.Pipe?

I have the current version of cabal and running cabal install Pipe gave me no issues. But I tried these two imports:
import Control.Proxy
import Control.Pipe
But I'm getting this error message:
Could not find module `Control.Pipe'
It is not a module in the current program, or in any known package.
And the same for Proxy.
Any ideas?
It looks like you have installed Pipe. You probably meant to install pipes.

Import monad state

I'm trying to import the monad State.
I did the following command:
:m Control.Monad.State
But the module cannot be found. I'm using GHCi, version 7.0.4:.
Can you give me some hint to fix the problem?
Thank you.
You're missing the mtl package.
You can either install it from Hackage yourself; or install the Haskell Platform, which comes with the necessary libraries.

Resources