As mentioned in #280, most of the code examples on the Persistent page don't compile with recent versions of the persistent package due to missing language extensions. This isn't so bad because there is a helpful compiler message that tells exactly what to do:
Generating Persistent entities now requires the following language extensions:
StandaloneDeriving
FlexibleInstances
Please enable the extensions by copy/pasting these lines into the top of your file:
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
But it would probably still be better to have the examples work as they are.
Unless perhaps it's meant to be like this because the book is written for an older version of Persistent, before these extensions were required? :thinking:
As mentioned in #280, most of the code examples on the Persistent page don't compile with recent versions of the
persistent
package due to missing language extensions. This isn't so bad because there is a helpful compiler message that tells exactly what to do:But it would probably still be better to have the examples work as they are.
Unless perhaps it's meant to be like this because the book is written for an older version of Persistent, before these extensions were required? :thinking:
But then, it has already been updated for one example in https://github.com/yesodweb/yesodweb.com-content/pull/279 so I guess it's meant to be like that for all of them...