I'm new to Haskell. How come when I try to use Days
from Data.Time
I get this error:
Could not find module `Data.Time':
It is a member of the hidden package `time-1.1.4'.
Perhaps you need to add `time' to the build-depends in your .cabal file.
I am importing Data.List and Control.Monad, and neither gives me this error message, but the code import Data.Time
does.
What am I missing?
Thanks for the help!
EDIT: I'm getting a similar error message when I use: import Directory
Thanks guys, your answers got me on track!
Haskell modules are a useful way to group a set of related functionalities into a single package and manage different functions that may have the same names. The module definition is the first thing that goes in your Haskell file. the name of the module begins with a capital letter; each file contains only one module.
Basic Haskell Commands :quit (or :q) :load [filename] (or :l [filename]) :reload -- reload the current file set after you'ved edited it (or :r) :cd -- change to another directory.
A qualified import allows using functions with the same name imported from several modules, e.g. map from the Prelude and map from Data.
Prelude is a module that contains a small set of standard definitions and is included automatically into all Haskell modules.
Fire up Leksah with this project, open the package menu and select "edit package" from it. Now, choose "dependencies" and add the dependency you need (in your case time
). You may also choose a version.
PS: Don't forget to hit the "save" button afterwards. (I think this is a design failure...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With