首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Haskell无法构建带有DateTime依赖关系的项目,尽管stack.yaml中有条目

Haskell无法构建带有DateTime依赖关系的项目,尽管stack.yaml中有条目
EN

Stack Overflow用户
提问于 2019-06-28 12:59:17
回答 1查看 101关注 0票数 0

因此,我试图添加这个包:datetime-0.3.1和我在stack.yaml文件中添加了我认为正确的引用。我试过使用堆栈求解器,但似乎已经不存在了。我还寻找了一些等价的pip,所以我可以只做堆栈安装日期时间-0.3.1或类似的东西,但这似乎不是堆栈所做的事情。

守则:

代码语言:javascript
复制
module FhirDataTypes (
    FhirId (..),
    toFhirId
) where

import Data.Maybe (Maybe(..))
import Data.List (length)
import Coding as Coding
import Data.Decimal
import FhirUri (FhirUri(..))
import FhirString (FhirString(..))
import SimpleQuantity (SimpleQuantity(..))
import Data.DateTime

newtype FhirId = FhirId FhirString deriving (Show)

toFhirId :: FhirString -> Maybe FhirId
toFhirId fs@(FhirString s)
    | length s > 64 = Nothing
    | otherwise = Just $ FhirId fs

data Money = Money  { value :: Decimal
                    , currency :: Code
}

data Range = Range  {   low :: SimpleQuantity
                    ,   high :: SimpleQuantity
}

data Ratio = Ratio  {   numerator :: Quantity
                    ,   denominator :: Quantity
}

data Period = Period    { start :: DateTime
                        , end :: DateTime
}

我所犯的错误:

代码语言:javascript
复制
PS C:\util\haskell\fhir-practice> stack build

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for fhir-practice-0.1.0.0:
DateTime needed, but the stack configuration has no specified version (no package with that name found, perhaps there is a typo in
         a package's build-depends or an omission from the stack.yaml packages list?) needed since fhir-practice is a build target.

Some different approaches to resolving this:


Plan construction failed.

我的stack.yaml文件:

代码语言:javascript
复制
flags: {}
packages:
- .
extra-deps: 
- network-  uri-2.6.1.0@sha256:62cc45c66023e37ef921d5fb546aca56a9c786615e05925fb193a70bf0913690
- Decimal-0.4.2
- datetime-0.3.1
resolver: lts-13.24
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-28 14:30:10

  1. stack install主要用于全局安装二进制文件,而不是用于特定于项目的包。
  2. 您可能希望使用time包,而不是datetime。因为前者是积极维持的。此外,在您的示例中,时间存在于LTS-13.24中,因此不需要将它添加到额外的deps中。外接-deps字段仅适用于不存在于解析器中的依赖项(包括传递依赖项)。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56807423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档