因此,我试图添加这个包:datetime-0.3.1和我在stack.yaml文件中添加了我认为正确的引用。我试过使用堆栈求解器,但似乎已经不存在了。我还寻找了一些等价的pip,所以我可以只做堆栈安装日期时间-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发布于 2019-06-28 14:30:10
stack install主要用于全局安装二进制文件,而不是用于特定于项目的包。time包,而不是datetime。因为前者是积极维持的。此外,在您的示例中,时间存在于LTS-13.24中,因此不需要将它添加到额外的deps中。外接-deps字段仅适用于不存在于解析器中的依赖项(包括传递依赖项)。https://stackoverflow.com/questions/56807423
复制相似问题