Date-time package in haskell - error in the current one, can't find an analog

504 views Asked by At

When I was installing the package datetime I got an error in it:

$ cabal install datetime
Resolving dependencies...
Configuring datetime-0.2.1...
Building datetime-0.2.1...
Preprocessing library datetime-0.2.1...
[1 of 1] Compiling Data.DateTime    ( src/Data/DateTime.lhs, dist/dist-sandbox-5f6496af/build/Data/DateTime.o )

src/Data/DateTime.lhs:139:31:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at src/Data/DateTime.lhs:8:3-25
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at src/Data/DateTime.lhs:12:3-22

src/Data/DateTime.lhs:142:29:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at src/Data/DateTime.lhs:8:3-25
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at src/Data/DateTime.lhs:12:3-22

src/Data/DateTime.lhs:144:15:
    Ambiguous occurrence ‘iso8601DateFormat’
    It could refer to either ‘Data.Time.Format.iso8601DateFormat’,
                             imported from ‘Data.Time.Format’ at src/Data/DateTime.lhs:8:3-25
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.iso8601DateFormat’,
                             imported from ‘System.Locale’ at src/Data/DateTime.lhs:12:3-22
Failed to install datetime-0.2.1
cabal: Error: some packages failed to install:
datetime-0.2.1 failed during the building phase. The exception was:
ExitFailure 1

Since its repository at github doesn't exist anymore, what do you suggest me: somehow fix the error or chose another package? I tried to find another find but couldn't. What I need is to be able to work with the date-times.

1

There are 1 answers

1
danza On

Luckily Stack Builders wrote a version which is compatible with the latest compiler. You can find the source here. As the repo doc says, this is updated to Hackage with the name datetime-sb, so you can install it and use it in your dependencies exactly like the original library, just substituting datetime with datetime-sb wherever you need to refer to the package name


Edit:

Eventually Stack Builders took over maintaining the datetime package. This problem should not happen anymore for anybody