I am trying to import ByteArray ,from the Cryptonite library.
My cabal file has cryptonite in the Build depends ,and my import statement looks like this
import Crypto.Internal.ByteArray (ByteArray, Bytes)
import qualified Crypto.Internal.ByteArray as B
The error I get is
Could not load module ‘Crypto.Internal.ByteArray’
it is a hidden module in the package ‘cryptonite-0.25’
I have seen other code examples which use this specific import statement ,what am I missing here?
As per GHC Docs, hidden modules
"cannot be imported, but they are still subject to the overlapping
constraint: no other package in the same program may provide a module
of the same name."
Related
I'm trying to analyze customer shopping data and I'm trying this using lifetimes package in Python.I'm unable to import estimation module in lifetime
from lifetimes.utils import *
from lifetimes.plotting import *
from lifetimes.estimation import *
from lifetimes.estimation import *
ModuleNotFoundError: No module named 'lifetimes.estimation'
install lifetimes version 0.2.2.2
https://pypi.org/project/Lifetimes/0.2.2.2/
pip install Lifetimes==0.2.2.2
Thought to expand on it a bit more in case anyone else faces the same issue (due to following redundant codes).
The lifetimes.estimation module is no longer available within the lifetimes package (as per the latest model documentation). All the functionalities in this module were moved to other modules and you really do not need this module anymore. Continue using the latest model version 0.11.1 and don't import this specific submodule.
I've recently started coding in Sublime Text. This has brought to my attention some warnings I didn't notice when I used Leksah. So I got this one:
import qualified Data.Set as S
Gives:
Warning:
The qualified import of `Data.Set' is redundant
except perhaps to import instances from `Data.Set'
To import instances alone, use: import Data.Set()
On the other hand, either of these two imports from Data.Foldable don't give any warnings:
import Data.Foldable (foldrM, mapM_,foldr,foldl',concat)
-- or
import Data.Foldable
So I'm not really sure what the warning for Data.Set means. I would expect "redundant" means that it's not necessary. If I remove the import it doesn't compile because I'm using a lot of things for Data.Set.
Meanwhile sitting next to it is import qualified Data.Map as M which also gives no warnings.
So I'm completely confused about what that warning is saying.
It generally means either :
you import a module but you don’t use it at all,
you import a module that is already imported by another module you import.
It may be the effect of some refactoring where you don’t use the module anymore. Or maybe you’ve anticipated the future use of this module by importing it.
This message is generated when you compile your project using the -Wall option.
Try to delete the line which shows the error, it often works ;-)
I'm really new to haskell, and I'm having a problem importing any modules whatsoever.
When I load an .hs file that contains nothing but
import Data.list
it gives me an error of
file.hs:1:8: parse error on input Data.list
I know I must be making a really basic error somewhere, because imports seem to be working for everyone else, even in all the tutorials. Is it because I've changed my directory with :cd? Or is it how my GHCi was downloaded?
Modules start with capital letters
import Data.List
Module names are capitalized.
Capitalize the word "List".
import Data.List
I needed some functions out of a hidden module. If I import Graphics.UI.Gtk.Types I recieve:
Could not find module `Graphics.UI.Gtk.Types'
it is a hidden module in the package `gtk-0.12.4'
How can I import this hidden module without editing and recompiling gtk?
No you can not expose modules that are not exported by a package. If you need something from that module to use the package then the functionality should be available via another (exposed) module.
I saw much lines like import HSP.ServerPartT() - list of imports is empty. Why is this done? What difference with just not importing this module?
It imports only typeclass instances from the module. With -Wall, GHC issues a warning for modules that are imported but from which no definitions are used:
foo.hs:1:1:
Warning: The import of `M' is redundant
except perhaps to import instances from `M'
To import instances alone, use: import M()
The empty import list silences this warning and serves as documentation of the purpose of the import.
That form imports nothing but the instances from that module. And that's the reason of that form, you want to have the instances in scope, but nothing else.