[Haskell-beginners] importing Data.Digits

David McBride toad3k at gmail.com
Mon Nov 18 13:11:30 UTC 2019


This particular module comes from a separate package.  By default all
modules you use happen to be in the base package, which ships with ghc.  To
use other libraries you must make a proper project which tells ghc which
libraries you are using.  For example, the digits package uses this cabal
file at http://hackage.haskell.org/package/digits-0.3.1/digits.cabal

You can find more information about how to start a package from scratch
here https://www.haskell.org/cabal/users-guide/developing-packages.html

On Mon, Nov 18, 2019 at 7:31 AM Alexander Chen <alexander at chenjia.nl> wrote:

> Hi All,
>
> This is my first 'post' not quite sure if I am doing it right.
>
> I have a question about the importing of modules that are available on the
> Hackage.Haskell site:
> http://hackage.haskell.org/package/digits
>
> if I write this in my wordpad and then load it to GCI i get the following
> error:
>
>
> chapter4.hs:1:1: error:
>     Could not find module ‘Data.Digits’
>     Perhaps you meant Data.Bits (from base-4.12.0.0)
>     Use -v to see a list of the files searched for.
>   |
> 1 | import Data.Digits   | ^^^^^^^^^^^^^^^^^^
>
>
> However if I load Data.Char than it loads fine.
>
> What am I doing wrong?
>
> best,
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20191118/e3c17e0d/attachment.html>


More information about the Beginners mailing list