yesodweb / yesodweb.com-content

Content for the www.yesodweb.com site
http://www.yesodweb.com/
Other
67 stars 112 forks source link

Missing language extensions and incorrect call to mkSave #275

Closed cryptophonic closed 12 months ago

cryptophonic commented 1 year ago

Probably need to update the examples in the docs here https://www.yesodweb.com/book/persistent to not use mkSave. Changing mkSave in the examples to mkEntityDefList fixed an obscure error that took a bit of searching to identify, because Hackage shows mkSave as still being valid for Database.Persist.TH package.

I was able to identify the issue thanks to the last comment in this closed issue: https://github.com/yesodweb/yesodweb.com-content/issues/214

Also, had to add the following language extensions to my code that were not in the example:

{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE DataKinds #-}

The good news is after fixing these the example code runs fine for me.