I have the following model in config/models
:
Post json
title Text
intro Text
posted UTCTime default=now()
published Bool default=true
content Markdown Maybe
cvId CvItemId Maybe
projectId ProjectId Maybe
I have Yesod.Text.Markdown, which clearly defines a PersistField installed and imported in src/Models.hs
. In this file, the models are generated using the following piece of code:
share [mkPersist sqlSettings, mkMigrate "migrateAll"]
$(persistFileWith lowerCaseSettings "config/models")
On trying to build, I get the following error:
src/Model.hs:20:7: error:
• Not in scope: type constructor or class ‘Markdown’
• In the untyped splice:
$(persistFileWith lowerCaseSettings "config/models")
|
20 | $(persistFileWith lowerCaseSettings "config/models")
|
How do I make this work? I could probably make it work by avoiding TemplateHaskell, but I'd like to stick with this format, as it's much more elegant.