haskelltimedependencieshackagehaskell-time

Using Haskell Time library ISO8601 format


I'm using the Haskell Time Library. I'm trying to use the ISO-8601 date formatters.

In my code, I can import the Data.Time module and use it without any problems. However, when I import the Data.Time.Format.ISO8601 functions and definitions I get the following error: Could not find module.

I'm new to Haskell and I'm not confident in my ability to understand dependencies in the package manager yet. I have a Java oriented background.


Solution

  • I finally manage to understand what was going on thanks to Trevor Cook's comment.

    Stack pulls dependencies from Stackage by default, which did not contain the latest time package version. So I needed to specify the version to force stack to use Hackage instead of Stackage for my time package resolution by adding an extra-dep in my stack.yaml file:

    extra-deps:
    - time-1.9.2
    

    After running stack build the compiler was able to find the ISO 8601 Date Format module.