Created
October 11, 2013 14:45
-
-
Save bergmark/6935922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE | |
EmptyDataDecls | |
, FlexibleContexts | |
, GADTs | |
, OverloadedStrings | |
, QuasiQuotes | |
, TemplateHaskell | |
, TypeFamilies | |
#-} | |
module Bar where | |
import Database.Persist.TH | |
import Database.Persist | |
import Settings | |
import qualified Foo as F | |
share [mkPersist mySettings, mkMigrate "migrateAll"] [persistLowerCase| | |
Bar | |
fooId F.FooId | |
|] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bar.hs:17:1: | |
Could not deduce (persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) | |
arising from a use of `persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType' | |
from the context (monad-control-0.3.2.1:Control.Monad.Trans.Control.MonadBaseControl | |
IO m, | |
transformers-0.3.0.0:Control.Monad.IO.Class.MonadIO m, | |
monad-logger-0.3.2.0:Control.Monad.Logger.MonadLogger m) | |
bound by the type signature for | |
migrateAll :: (monad-control-0.3.2.1:Control.Monad.Trans.Control.MonadBaseControl | |
IO m, | |
transformers-0.3.0.0:Control.Monad.IO.Class.MonadIO m, | |
monad-logger-0.3.2.0:Control.Monad.Logger.MonadLogger m) => | |
persistent-1.2.3.0:Database.Persist.Sql.Types.Migration | |
(persistent-1.2.3.0:Database.Persist.Sql.Types.SqlPersistT m) | |
at Bar.hs:(17,1)-(20,2) | |
Possible fix: | |
add (persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) to the context of | |
the type signature for | |
migrateAll :: (monad-control-0.3.2.1:Control.Monad.Trans.Control.MonadBaseControl | |
IO m, | |
transformers-0.3.0.0:Control.Monad.IO.Class.MonadIO m, | |
monad-logger-0.3.2.0:Control.Monad.Logger.MonadLogger m) => | |
persistent-1.2.3.0:Database.Persist.Sql.Types.Migration | |
(persistent-1.2.3.0:Database.Persist.Sql.Types.SqlPersistT m) | |
or add an instance declaration for | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) | |
In the fourth argument of `FieldDef', namely | |
`persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)' | |
In the expression: | |
FieldDef | |
(HaskellName (Database.Persist.TH.pack' "fooId")) | |
(DBName (Database.Persist.TH.pack' "foo_id")) | |
(FTTypeCon | |
(Just (Database.Persist.TH.pack' "F")) | |
(Database.Persist.TH.pack' "FooId")) | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)) | |
[] | |
True | |
Nothing | |
In the fifth argument of `EntityDef', namely | |
`[FieldDef | |
(HaskellName (Database.Persist.TH.pack' "fooId")) | |
(DBName (Database.Persist.TH.pack' "foo_id")) | |
(FTTypeCon | |
(Just (Database.Persist.TH.pack' "F")) | |
(Database.Persist.TH.pack' "FooId")) | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)) | |
[] | |
True | |
Nothing]' | |
Bar.hs:17:1: | |
Could not deduce (persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) | |
arising from a use of `persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType' | |
from the context (typ ~ F.FooId) | |
bound by a pattern with constructor | |
FooId :: forall typ. typ ~ F.FooId => EntityField Bar typ, | |
in an equation for `persistFieldDef' | |
at Bar.hs:(17,1)-(20,2) | |
Possible fix: | |
add (persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) to the context of | |
the data constructor `FooId' | |
or the type signature for | |
persistFieldDef :: EntityField Bar typ -> FieldDef SqlType | |
or add an instance declaration for | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) | |
In the fourth argument of `FieldDef', namely | |
`persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)' | |
In the expression: | |
FieldDef | |
(HaskellName (Database.Persist.TH.pack' "fooId")) | |
(DBName (Database.Persist.TH.pack' "foo_id")) | |
(FTTypeCon | |
(Just (Database.Persist.TH.pack' "F")) | |
(Database.Persist.TH.pack' "FooId")) | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)) | |
[] | |
True | |
Nothing | |
In an equation for `persistFieldDef': | |
persistFieldDef FooId | |
= FieldDef | |
(HaskellName (Database.Persist.TH.pack' "fooId")) | |
(DBName (Database.Persist.TH.pack' "foo_id")) | |
(FTTypeCon | |
(Just (Database.Persist.TH.pack' "F")) | |
(Database.Persist.TH.pack' "FooId")) | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)) | |
[] | |
True | |
Nothing | |
Bar.hs:17:1: | |
Could not deduce (persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) | |
arising from a use of `persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType' | |
from the context (Monad m) | |
bound by the type signature for | |
entityDef :: Monad m => m Bar -> EntityDef SqlType | |
at Bar.hs:(17,1)-(20,2) | |
Possible fix: | |
add (persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) to the context of | |
the type signature for | |
entityDef :: Monad m => m Bar -> EntityDef SqlType | |
or add an instance declaration for | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.PersistFieldSql | |
F.FooId) | |
In the fourth argument of `FieldDef', namely | |
`persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)' | |
In the expression: | |
FieldDef | |
(HaskellName (Database.Persist.TH.pack' "fooId")) | |
(DBName (Database.Persist.TH.pack' "foo_id")) | |
(FTTypeCon | |
(Just (Database.Persist.TH.pack' "F")) | |
(Database.Persist.TH.pack' "FooId")) | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)) | |
[] | |
True | |
Nothing | |
In the fifth argument of `EntityDef', namely | |
`[FieldDef | |
(HaskellName (Database.Persist.TH.pack' "fooId")) | |
(DBName (Database.Persist.TH.pack' "foo_id")) | |
(FTTypeCon | |
(Just (Database.Persist.TH.pack' "F")) | |
(Database.Persist.TH.pack' "FooId")) | |
(persistent-1.2.3.0:Database.Persist.Sql.Class.sqlType | |
(Nothing :: Maybe F.FooId)) | |
[] | |
True | |
Nothing]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE | |
EmptyDataDecls | |
, FlexibleContexts | |
, GADTs | |
, OverloadedStrings | |
, QuasiQuotes | |
, TemplateHaskell | |
, TypeFamilies | |
#-} | |
module Foo where | |
import Database.Persist.TH | |
import Settings | |
share [mkPersist mySettings, mkMigrate "migrateAll"] [persistLowerCase| | |
Foo | |
|] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Settings where | |
import Database.Persist.TH | |
mySettings :: MkPersistSettings | |
mySettings = sqlSettings { mpsGeneric = False, mpsPrefixFields = False } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment