[英]Haskell-Stack failing to build project with DateTime dependency despite entry in stack.yaml
因此,我嘗試添加此程序包: datetime-0.3.1,並在stack.yaml文件中添加了我認為是正確的引用。 我嘗試使用堆棧求解器,但似乎不再存在。 我還尋找了一些等價的pip,因此我可以進行堆棧安裝datetime-0.3.1或類似的操作,但這似乎不是堆棧所做的。
編碼:
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
}
我得到的錯誤:
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文件:
flags: {}
packages:
- .
extra-deps:
- network- uri-2.6.1.0@sha256:62cc45c66023e37ef921d5fb546aca56a9c786615e05925fb193a70bf0913690
- Decimal-0.4.2
- datetime-0.3.1
resolver: lts-13.24
stack install
主要用於全局安裝二進制文件,而不用於特定於項目的軟件包。
您可能要使用time
包,而不是datetime
。 因為前者是積極維護的。 此外,在您的情況下,LTS-13.24中存在時間 ,因此您無需將其添加到特快運動中。 extra-deps字段僅用於解析器中不存在的依賴項(包括傳遞性)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.