Giter Site home page Giter Site logo

Comments (6)

rockbmb avatar rockbmb commented on September 8, 2024

PR #87 fixes #77, so if it gets merged this issue can be completed.

from http-api-data.

rockbmb avatar rockbmb commented on September 8, 2024

This issue can be easily fixed with this function recently introduced to time, but it cannot be implemented yet.

It relies on time-1.9.1, and trying to use it gives the following problem:

In the dependencies for Cabal-2.2.0.1:
    time-1.9.1 from stack configuration does not match >=1.4 && <1.9  (latest
               matching version is 1.8.0.4)
needed due to http-api-data-0.3.10 -> Cabal-2.2.0.1

In the dependencies for directory-1.3.1.5:
    time-1.9.1 from stack configuration does not match >=1.4 && <1.9  (latest
               matching version is 1.8.0.4)
needed due to http-api-data-0.3.10 -> directory-1.3.1.5

In the dependencies for unix-2.7.2.2:
    time-1.9.1 from stack configuration does not match >=1.2 && <1.9  (latest
               matching version is 1.8.0.4)
needed due to http-api-data-0.3.10 -> unix-2.7.2.2

The newest version of directory, 1.3.3.1, already uses time (>=1.4 && <1.10), and the unreleased 2.8.0.0 version of unix as well. However, the latest published version of Cabal, which is 2.4.0.1, still uses time (>=1.4.0.1 && <1.9), and the latest published version of unix, 2.7.2.2, uses time (>=1.2 && <1.9).

As such, a way should be found to fix this problem without relying on a newer version of time, at least for the time being.

from http-api-data.

fizruk avatar fizruk commented on September 8, 2024

Indeed. For earlier versions I guess we can use realToFrac :: NominalDiffTime -> Pico.

@rockbmb are you willing to submit a PR? 😊

I think you can use CPP to produce something like this:

#if MIN_VERSION_time(1,9,1)
nominalDiffTimeToSeconds
#else
(realToFrac :: NominalDiffTime -> Pico)
#endif

@phadej is it okay to use CPP here?

from http-api-data.

phadej avatar phadej commented on September 8, 2024

I'd write something like

import Data.Time (NominalDiffTime)

#if MIN_VERSION_time(1,9,1)
import Data.Time (nominalDiffTimeToSeconds)
#endif

-- possibly more imports

#if !MIN_VERSION_time(1,9,1)
nominalDiffTimeToSeconds :: NominalDiffTime -> Pico
nominalDiffTimeToSeconds = realToFrac
#endif

from http-api-data.

rockbmb avatar rockbmb commented on September 8, 2024

@fizruk will submit a PR 👍

from http-api-data.

phadej avatar phadej commented on September 8, 2024

Fixed in #88 #89

from http-api-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.