【发布时间】:2019-06-28 12:59:17
【问题描述】:
所以我正在尝试添加这个包:datetime-0.3.1 并且我在 stack.yaml 文件中添加了我认为的正确引用。我尝试使用堆栈求解器,但它似乎不再存在。我还寻找了一些等效的 pip 所以我可以做 stack install 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
【问题讨论】:
-
(1)
stack install主要用于全局安装二进制文件,而不是项目特定的包。 (2) 你有.cabal文件还是package.yaml文件?在dependencies下是否拼写出datetime?注意全小写拼写。尚不清楚为什么堆栈认为DateTime是合适的大小写。 (3) 您确定要datetime而不是time?后者仍在维护中,而 last upload 的datetime是 4 年前的。 -
如果您想发表您的评论作为答案,我很乐意将其标记为这样。使用 UTCTime 而不是 DateTime 并在 stack.yaml (time-1.8.0.2@sha256:e71437d137e609599afd09f70d50a4d20a123610d303d03ab094440a5a77cc6b,5409) 中添加引用解决了问题
标签: haskell cabal haskell-stack build-error