7
Một chút nhầm lẫn với kết quả tôi nhận được. Sử dụng như sau:Lỗi Haskell mẫu khi sử dụng "bắt nguồn"
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :m + Language.Haskell.TH
tôi nhận được kết quả thành công này:
Prelude Language.Haskell.TH> runQ [d| data X = X |]
[DataD [] X_0 [] [NormalC X_1 []] []]
Nhưng tôi nhận được lỗi này:
Prelude Language.Haskell.TH> runQ [d| data X = X deriving Show |]
<interactive>:4:30:
The exact Name `X' is not in scope
Probable cause: you used a unique name (NameU) in Template Haskell but did not bind it
In the Template Haskell quotation [d| data X = X deriving (Show) |]
In the first argument of `runQ', namely
`[d| data X = X deriving (Show) |]'
In the expression: runQ [d| data X = X deriving (Show) |]
tôi không thể lấy được Hiển thị thời điểm sử dụng Template Haskell?
Tôi đang sử dụng nền tảng Haskell 2012,4. Đoán tôi hoặc cần cập nhật GHC theo cách thủ công hoặc chờ bản phát hành lớn tiếp theo ... – me2
Bản phát hành lớn tiếp theo (2013.2) [dự kiến trong nửa đầu tháng 5] (http://article.gmane.org/gmane.comp .lang.haskell.platform/2484). –