Reputation: 453
I am attempting to create a Persistent type that is modeled something like:
MyModel
something Text
somethingElse [Int]
and I get an error:
Illegal type constructor or class name: `[Int]' When splicing a TH declaration: data MyModel = MyModel {myModelSomething :: Text, myModelSomethingElse :: [Int]} deriving (Show, Read, Eq)
Any help is appreciated.
Upvotes: 3
Views: 486
Reputation: 31335
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.
Upvotes: 2