Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建一个持久类型,该类型的模型类似于:
MyModel something Text somethingElse [Int]
我得到一个错误:
非法类型构造函数或类名:`[Int]' 拼接 TH 声明时:data MyModel = MyModel {myModelSomething :: Text, myModelSomethingElse :: [Int]} deriving (Show, Read, Eq)
任何帮助表示赞赏。
This is just a limitation of the Persistent syntax. To get around it, define a type synonym in your Haskell code (before the mkPersist call) like:
type Ints = [Int]
Then replace [Int] with Ints in your declaration, it should work.
[Int]
Ints