Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running gigasecond test #80

Closed
karptonite opened this issue Jun 10, 2015 · 14 comments · Fixed by #81
Closed

Error running gigasecond test #80

karptonite opened this issue Jun 10, 2015 · 14 comments · Fixed by #81

Comments

@karptonite
Copy link

I'm getting the following error when trying to run the Gigasecond test:

gigasecond_test.hs:9:15:
    Couldn't match expected type ‘time-1.5.0.1:Data.Time.Format.Locale.TimeLocale’
                with actual type ‘System.Locale.TimeLocale’
    NB: ‘time-1.5.0.1:Data.Time.Format.Locale.TimeLocale’
          is defined in ‘Data.Time.Format.Locale’ in package ‘time-1.5.0.1’
        ‘System.Locale.TimeLocale’
          is defined in ‘System.Locale’ in package ‘old-locale-1.0.0.7’
    In the first argument of ‘readTime’, namely ‘defaultTimeLocale’
    In the expression:
      readTime defaultTimeLocale (iso8601DateFormat (Just "%T%Z"))

I'm not sure if this is a problem in the test or if it is a problem in my Haskell install or even if it is in my solution (although from the error message, it doesn't look like the problem is in my solution). I'm (obviously) pretty new to Haskell, so I'm sorry I can't be more help in diagnosing this.

I'm on OSX with ghc, and installed via Brew, and HUnit installed via cabal, apparently up to date on everything.

Apologies if this is my problem, and should have been posted elsewhere!

@kytrinyx
Copy link
Member

This is the right place for it. @etrepum do you know what might be going on here?

@etrepum
Copy link
Contributor

etrepum commented Jun 10, 2015

Pretty sure this is a problem with your solution, but I can't quite tell because you didn't post any of it.

@etrepum
Copy link
Contributor

etrepum commented Jun 10, 2015

Also, which version of GHC are you using?

@karptonite
Copy link
Author

GHC version 7.10.1
my solution:

module Gigasecond (fromDay)
where
import Data.Time.Clock

fromDay :: UTCTime -> UTCTime
fromDay = addUTCTime 1000000000

@karptonite
Copy link
Author

I just checked out this repo, and ran the _test tests. Gigasecond is one of the ones that fails (among several others). Perhaps this is a Haskell version problem? Or am I missing some packages? Probably some combination? Anyone with GHC 7.10.1 that can try running these tests?
https://gist.github.com/karptonite/37dc7b0d0d355e8e3437#file-gistfile1-txt-L83

@etrepum
Copy link
Contributor

etrepum commented Jun 10, 2015

Yeah, it was GHC 7.10. Your solution is fine. Thanks! 👍

@etrepum
Copy link
Contributor

etrepum commented Jun 10, 2015

It's a bit tricky to have this stuff all work without warnings from GHC 7.6 onwards! :)

@karptonite
Copy link
Author

Thanks--that was fast! How long before the new version should be available with exercism fetch?

@etrepum
Copy link
Contributor

etrepum commented Jun 10, 2015

Not sure, I don't have visibility beyond just maintaining the track. @kytrinyx ?

@karptonite
Copy link
Author

Might be worth adding newer versions of Haskell to the .travis.yml file. I started on a pull request for it, but was unable to run the tests in Travis because the bootstrap.sh file use sudo.

@etrepum
Copy link
Contributor

etrepum commented Jun 11, 2015

Lots of people still use 7.6 due to Linux distros, so we definitely need to keep that. At the time I set this up, Travis support for Haskell didn't really work, so I had to roll my own. Not sure if any of that has changed.

@kytrinyx
Copy link
Member

I try to deploy daily-ish, but sometimes things get hectic and I miss a day or two. I'm deploying now.

@karptonite
Copy link
Author

@etrepum it looks as if travis supports Haskell now. http://docs.travis-ci.com/user/languages/haskell/

@etrepum
Copy link
Contributor

etrepum commented Jun 14, 2015

It's a bit more complicated than just using that. Best not to discuss this on a closed ticket, I created #82 for further discussion and to track any progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants